Mnet::Log::Conditional - Use Mnet::Log if Mnet::Log is loaded
use Mnet::Log::Conditional qw( DEBUG INFO WARN FATAL ); # nothing will happen unless Mnet::Log was loaded INFO("starting"); # errors will still always go to stderr WARN("error"); FATAL("abort"); my $log = Mnet::Log::Conditional->new($opts); $log->DEBUG("object oriented interace");
Mnet::Log::Conditional can be called to output log entries only if the Mnet::Log module has already been otherwise loaded.
This is used by other Mnet modules for logging, so that they generate log output only if the calling script is using the Mnet::Log module. Users who create custom modules may want to do the same thing.
Refer to Mnet::Log for more information.
Mnet::Log::Conditional implements the methods listed below.
$log = Mnet::Log::Conditional->new(\%opts)
This class method creates a new Mnet::Log::Conditional object. The opts hash ref argument is not requried but may be used to override any parsed cli options parsed with the Mnet::Opts::Cli module.
The returned object may be used to call other documented functions and methods in this module, which will call the Mnet::Log module if it is loaded.
Refer to the new method in perldoc Mnet::Log for more information.
$log->debug($text)
Output a debug entry using the Mnet::Log module, if loaed.
$log->info($text)
Output an info entry using the Mnet::Log module, if loaed.
$log->warn($text)
Output a warn entry using the Mnet::Log module, if loaed.
$log->fatal($text)
Output a fatal entry using the Mnet::Log module, if loaded.
Mnet::Log::Conditional also implements the functions listed below.
DEBUG($text)
INFO($text)
WARN($text)
FATAL($text)
Output a fatal entry using the Mnet::Log module, if loaed.
Mnet
Mnet::Log
To install Mnet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mnet
CPAN shell
perl -MCPAN -e shell install Mnet
For more information on module installation, please visit the detailed CPAN module installation guide.