Skip to content

Commit

Permalink
Merge branch 'feature/log-files-used-for-config'
Browse files Browse the repository at this point in the history
  • Loading branch information
cromedome committed Mar 22, 2021
2 parents 8ce24e5 + 4fc9aa0 commit 3616afc
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Changes
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
{{$NEXT}}

[ BUG FIXES ]
* None

[ ENHANCEMENTS ]
* PR #1601: Log files used to build config (Nick Tonkin)
* PR #1608: Migrate CLI to CLI::Osprey (Jason A. Crome)

[ DOCUMENTATION ]
* None

0.301001 2021-03-17 08:52:34-04:00 America/New_York

[ BUG FIXES ]
* PR #1607: Fix broken tests following App::Cmd removal (Jason Crome)

[ ENHANCEMENTS ]
* PR #1606: Clean up various build prereqs (Graham Knop)
* PR #1608: Migrate CLI to CLI::Osprey (Jason A. Crome)

[ DOCUMENTATION ]
* None
Expand Down
2 changes: 2 additions & 0 deletions lib/Dancer2/Core/App.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,8 @@ sub BUILD {
my $self = shift;
$self->init_route_handlers();
$self->_init_hooks();

$self->log(core => 'Built config from files: ' . join(' ', @{$self->config_files}));
}

sub finish {
Expand Down
7 changes: 7 additions & 0 deletions t/app/t3/lib/App4.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package App4;
use strict;
use warnings;
use Dancer2;

1;

3 changes: 3 additions & 0 deletions t/app/t3/lib/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
logger : capture
log : core

17 changes: 17 additions & 0 deletions t/config-files-logged.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use strict;
use warnings;

use Test::More;
use File::Spec;

use lib '.';
use t::app::t3::lib::App4;

my ($app) = @{ Dancer2->runner->apps };
my $trap = $app->logger_engine->trapper;
my $logs = $trap->read;

like( $logs->[0]{message}, qr/Built config from files/, 'log message ok');

done_testing;

0 comments on commit 3616afc

Please sign in to comment.