diff options
author | Patrick Spek <p.spek@tyil.nl> | 2020-07-15 13:58:12 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2020-07-15 13:58:12 +0200 |
commit | 086d7f4d351fdb3ad46dbab1c47d49d7f97d5741 (patch) | |
tree | ffbfff9fa59f22696f4ea5f1d91a43861fdb7169 | |
parent | bbef19116102071a28344bbc54c9265ed9eafc34 (diff) | |
download | log-086d7f4d351fdb3ad46dbab1c47d49d7f97d5741.tar.gz log-086d7f4d351fdb3ad46dbab1c47d49d7f97d5741.tar.bz2 |
Handle printf-style logging in the role itself
This should make implementing the Log::Implementation role less tedious.
-rw-r--r-- | lib/Log/Implementation.rakumod | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Log/Implementation.rakumod b/lib/Log/Implementation.rakumod index 0bac2e1..65f2513 100644 --- a/lib/Log/Implementation.rakumod +++ b/lib/Log/Implementation.rakumod @@ -18,14 +18,14 @@ multi method info (Str:D $) { * } multi method debug (Str:D $) { * } # Methods for handling formatted messages. -multi method emergency (Str:D $template, *@args) { samewith($template.fmt(|@args)) } -multi method alert (Str:D $, *@) { * } -multi method critical (Str:D $, *@) { * } -multi method error (Str:D $, *@) { * } -multi method warning (Str:D $, *@) { * } -multi method notice (Str:D $, *@) { * } -multi method info (Str:D $, *@) { * } -multi method debug (Str:D $, *@) { * } +multi method emergency (Str:D $template, *@args) { self.emergency($template.fmt(|@args)) } +multi method alert (Str:D $template, *@args) { self.alert($template.fmt(|@args)) } +multi method critical (Str:D $template, *@args) { self.critical($template.fmt(|@args)) } +multi method error (Str:D $template, *@args) { self.error($template.fmt(|@args)) } +multi method warning (Str:D $template, *@args) { self.warning($template.fmt(|@args)) } +multi method notice (Str:D $template, *@args) { self.notice($template.fmt(|@args)) } +multi method info (Str:D $template, *@args) { self.info($template.fmt(|@args)) } +multi method debug (Str:D $template, *@args) { self.debug($template.fmt(|@args)) } # Method for configuration multi method add-output (IO::Handle:D $, Int() $ where Log::Level::Emergency ≤ * ≤ Log::Level::Debug, Callable $?) { * } |