aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2015-08-05 23:49:42 +0200
committerAngelo Naselli <anaselli@linux.it>2015-08-05 23:49:42 +0200
commit729f4220ad4eef55f47d235df394fec296cde8e4 (patch)
treefab6705fe287866ee3cf14da45bd2f2bc2e3d1b6 /lib
parent342b6facba845e24edb703b5131b6858416a2cf8 (diff)
downloadmanatools-729f4220ad4eef55f47d235df394fec296cde8e4.tar
manatools-729f4220ad4eef55f47d235df394fec296cde8e4.tar.gz
manatools-729f4220ad4eef55f47d235df394fec296cde8e4.tar.bz2
manatools-729f4220ad4eef55f47d235df394fec296cde8e4.tar.xz
manatools-729f4220ad4eef55f47d235df394fec296cde8e4.zip
Added Logger to Module
Diffstat (limited to 'lib')
-rw-r--r--lib/ManaTools/Module.pm31
1 files changed, 28 insertions, 3 deletions
diff --git a/lib/ManaTools/Module.pm b/lib/ManaTools/Module.pm
index ba65b356..a53b97ea 100644
--- a/lib/ManaTools/Module.pm
+++ b/lib/ManaTools/Module.pm
@@ -22,8 +22,10 @@
#Class Module
package ManaTools::Module;
-use ManaTools::Shared;
use Moose;
+use ManaTools::Shared;
+use ManaTools::Shared::Locales;
+use ManaTools::Shared::Logging;
=head1 VERSION
@@ -93,14 +95,14 @@ has 'launch' => (
has 'button' => (
is => 'rw',
- init_arg => undef,
+ init_arg => undef,
);
#=============================================================
=head2 loc
- loc attribute defines localization object taht use "manatools"
+ loc attribute defines localization object that uses "manatools"
domain as default. (see ManaTools::Shared::Locales for details).
To use your own Module domain, override this attribute by using
has '+loc' => (
@@ -121,6 +123,29 @@ has 'loc' => (
}
);
+#=============================================================
+
+=head2 logger
+
+ logger attribute defines the Logging object
+ see ManaTools::Shared::Logging for details and usage.
+
+=cut
+
+#=============================================================
+has 'logger' => (
+ is => 'ro',
+ isa => 'ManaTools::Shared::Logging',
+ init_arg => undef,
+ lazy => 1,
+ builder => '_loggerInitialize',
+);
+
+sub _loggerInitialize{
+ my $self = shift;
+
+ return ManaTools::Shared::Logging->new(ident => $self->name);
+}
#=============================================================