Doit::Log - logging with Doit
use Doit; use Doit::Log; info "information"; warning "warning"; error "this will die"; Doit::Log::set_label("hostname"); Doit::Log::set_label(undef);
Doit::Log is a package embedded in Doit.pm and provides functionality for screen logging. All logging functions create colored output, if Term::ANSIColor is available (but not on Windows).
info $message;
Write a green "INFO" with the given $message. By default exported.
warning $message;
Write a red "WARN" with the given $message. By default exported.
error $message;
Write a red "ERROR" with the given $message and throw an exception, similar to a die. By default exported.
Doit::Log::set_label("[additional label]"); Doit::Log::set_label(undef);
Set or unset an additional label which is used while logging. The first example would cause log output to look like this:
INFO [additional label]: message
The 2nd example would unset this change:
INFO: message
Slaven Rezic <srezic@cpan.org>
Copyright (c) 2017 Slaven Rezic. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Doit.
To install Doit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Doit
CPAN shell
perl -MCPAN -e shell install Doit
For more information on module installation, please visit the detailed CPAN module installation guide.