1. Fabrice Gabolde
  2. Floop

Commits

Fabrice Gabolde  committed 52f9f2d

Moved default logger building into builder method.

  • Participants
  • Parent commits 100660e
  • Branches default

Comments (0)

Files changed (1)

File lib/Floop.pm

View file
  • Ignore whitespace
     use HTTP::Date;
 
     has $!configuration is ro = Floop::Configuration->new;
-    has $!logger is ro = Floop::Logger::Console->new;
+    has $!logger is ro = $_->_build_logger;
     has $!work_directory is ro = dir('.');
     has $!static_files_directory is ro, lazy = dir($_->configuration->get_with_default('static', 'static'));
     has $!hooks is ro = {};
     has $!registered_plugins is ro = [];
     has $!mime_table is ro = MIME::Types->new(only_complete => 1);
 
+    method _build_logger {
+        Floop::Logger::Console->new;
+    }
+
     method BUILD {
         $self->_set_namespace('/')
             unless defined($self->namespace);