From be1db7a9c513ec59337f1d1ef57a8402e987c50c Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Thu, 2 Jul 2020 12:21:33 +0200
Subject: Rename some stuff around
---
META6.json | 4 +--
lib/Log.rakumod | 10 ++------
lib/Log/Abstract.rakumod | 56 -----------------------------------------
lib/Log/Implementation.rakumod | 57 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 61 insertions(+), 66 deletions(-)
delete mode 100644 lib/Log/Abstract.rakumod
create mode 100644 lib/Log/Implementation.rakumod
diff --git a/META6.json b/META6.json
index b42a639..1fc3601 100644
--- a/META6.json
+++ b/META6.json
@@ -10,9 +10,9 @@
"perl": "6.d",
"provides": {
"Log": "lib/Log.rakumod",
- "Log::Abstract": "lib/Log/Abstract.rakumod",
+ "Log::Implementation": "lib/Log/Implementation.rakumod",
"Log::Level": "lib/Log/Level.rakumod"
},
"source-url": "https://home.tyil.nl/git/raku/Log/",
"version": "0.2.0"
-}
\ No newline at end of file
+}
diff --git a/lib/Log.rakumod b/lib/Log.rakumod
index 946a21e..c308544 100644
--- a/lib/Log.rakumod
+++ b/lib/Log.rakumod
@@ -2,16 +2,10 @@
use v6.d;
-use Log::Abstract;
+use Log::Implementation;
use Log::Level;
-sub EXPORT
-{
- %(
- 'Log' => Log::Abstract,
- 'Log::Level' => Log::Level,
- )
-}
+unit module Log;
our $instance;
diff --git a/lib/Log/Abstract.rakumod b/lib/Log/Abstract.rakumod
deleted file mode 100644
index 81ec093..0000000
--- a/lib/Log/Abstract.rakumod
+++ /dev/null
@@ -1,56 +0,0 @@
-#! /usr/bin/env false
-
-use v6.d;
-
-use Log::Level;
-
-unit role Log::Abstract;
-
-# Methods for handling plain string messages.
-multi method emergency (Str:D $) { * }
-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 $) { * }
-
-# Methods for handling formatted messages.
-multi method emergency (Str:D $, *@) { * }
-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 $, *@) { * }
-
-# Method for configuration
-multi method add-output (IO::Handle:D $, Int() $ where Log::Level::Emergency ≤ * ≤ Log::Level::Debug, Callable $?) { * }
-
-=begin pod
-
-=NAME Log::Abstract
-=VERSION 0.2.0
-=AUTHOR Patrick Spek
-
-=begin LICENSE
-Copyright © 2020
-
-This program is free software: you can redistribute it and/or modify it under
-the terms of the GNU Lesser General Public License as published by the Free
-Software Foundation, version 3.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
-details.
-
-You should have received a copy of the GNU Lesser General Public License along
-with this program. If not, see http://www.gnu.org/licenses/.
-=end LICENSE
-
-=end pod
-
-# vim: ft=raku noet sw=8 ts=8
diff --git a/lib/Log/Implementation.rakumod b/lib/Log/Implementation.rakumod
new file mode 100644
index 0000000..a4ab7db
--- /dev/null
+++ b/lib/Log/Implementation.rakumod
@@ -0,0 +1,57 @@
+#! /usr/bin/env false
+
+use v6.d;
+
+use Log::Level;
+
+#| The role for a Log implementation.
+unit role Log::Implementation;
+
+# Methods for handling plain string messages.
+multi method emergency (Str:D $) { * }
+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 $) { * }
+
+# 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 $, *@) { * }
+
+# Method for configuration
+multi method add-output (IO::Handle:D $, Int() $ where Log::Level::Emergency ≤ * ≤ Log::Level::Debug, Callable $?) { * }
+
+=begin pod
+
+=NAME Log::Abstract
+=VERSION 0.1.1
+=AUTHOR Patrick Spek
+
+=begin LICENSE
+Copyright © 2020
+
+This program is free software: you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation, version 3.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License along
+with this program. If not, see http://www.gnu.org/licenses/.
+=end LICENSE
+
+=end pod
+
+# vim: ft=raku noet sw=8 ts=8
--
cgit v1.2.3