aboutsummaryrefslogtreecommitdiff
path: root/lib/Log.rakumod
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Log.rakumod')
-rw-r--r--lib/Log.rakumod26
1 files changed, 9 insertions, 17 deletions
diff --git a/lib/Log.rakumod b/lib/Log.rakumod
index 9a9004e..790d517 100644
--- a/lib/Log.rakumod
+++ b/lib/Log.rakumod
@@ -12,7 +12,7 @@ our $instance;
=begin pod
=NAME Log
-=VERSION 0.3.0
+=VERSION 0.3.1
=AUTHOR Patrick Spek <p.spek@tyil.nl>
=head1 Description
@@ -30,17 +30,17 @@ C<Log::Simple>, C<Log::Colored>, or C<Log::JSON>. The C<Log> role itself only
helps in ensuring the interfaces are the same, allowing easy replacement of the
implementation if ever needed in the future.
-Whatever imlementation of C<Log> you use, it C<must> be set in the C<$*LOG>
-dynamic variable. This makes it available to all the libraries that are used in
-the program. You C<should> set it as early as possible.
+Whatever implementation of C<Log> you use, it C<must> be set in the
+C<$Log::instance> variable. This makes it available to all the libraries that
+are used in the program. You C<should> set it as early as possible.
-Because it must be using the C<$*LOG> variable, module developers around the
-ecosystem can rely on it for their logging needs. However, not every
+Because it must be using the C<$Log::instance> variable, module developers
+around the ecosystem can rely on it for their logging needs. However, not every
application will implement this, and that needs to be accounted for, too. For
this, make use of Raku's C<with> flow control statement.
=begin code :lang<raku>
-.notice('This is a log message') with $*LOG;
+.notice('This is a log message') with $Log::instance;
=end code
This can be used freely and safely, throughout all modules. Any application
@@ -59,25 +59,17 @@ unit class Log::Custom is Log;
=head3 Methods
-There are 8 log levels, each with two method calls to invoke them. All of these
-I<must> be implemented.
+There are 8 log levels, each represented by a method calls to invoke them. All
+of these I<must> be implemented.
=item C<multi method emergency (Str:D $) { * }>
-=item C<multi method emergency (Str:D $, *@) { * }>
=item C<multi method alert (Str:D $) { * }>
-=item C<multi method alert (Str:D $, *@) { * }>
=item C<multi method critical (Str:D $) { * }>
-=item C<multi method critical (Str:D $, *@) { * }>
=item C<multi method error (Str:D $) { * }>
-=item C<multi method error (Str:D $, *@) { * }>
=item C<multi method warning (Str:D $) { * }>
-=item C<multi method warning (Str:D $, *@) { * }>
=item C<multi method notice (Str:D $) { * }>
=item C<multi method info (Str:D $) { * }>
-=item C<multi method info (Str:D $, *@) { * }>
-=item C<multi method notice (Str:D $, *@) { * }>
=item C<multi method debug (Str:D $0 { * }>
-=item C<multi method debug (Str:D $, *@) { * }>
Additionally, the following configuration method I<must> be implemented.