diff options
author | franck cuny <franck@lumberjaph.net> | 2010-06-03 14:52:53 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-06-04 12:16:51 +0200 |
commit | 59949f14ef0e3f04dda22a849969993069b6ddf3 (patch) | |
tree | 04c6a883937447e3cbab55d0558721b55620efd7 | |
parent | readme (diff) | |
download | dancer-logger-psgi-59949f14ef0e3f04dda22a849969993069b6ddf3.tar.gz |
swith to dist::zilla
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile.PL | 18 | ||||
-rw-r--r-- | README | 36 | ||||
-rw-r--r-- | dist.ini | 28 | ||||
-rw-r--r-- | lib/Dancer/Logger/PSGI.pm | 23 | ||||
-rw-r--r-- | t/01_basic.t | 10 |
6 files changed, 37 insertions, 79 deletions
diff --git a/.gitignore b/.gitignore index c38068c..31b003f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ Makefile.old nytprof.out MANIFEST.bak *.sw[po] +t/logs/ diff --git a/Makefile.PL b/Makefile.PL deleted file mode 100644 index df00b28..0000000 --- a/Makefile.PL +++ /dev/null @@ -1,18 +0,0 @@ -use inc::Module::Install; -name 'Dancer-Logger-PSGI'; -all_from 'lib/Dancer/Logger/PSGI.pm'; -readme_from 'lib/Dancer/Logger/PSGI.pm'; - -requires 'Plack'; -requires 'Plack::Middleware::ConsoleLogger'; -requires 'Test::TCP'; - -tests 't/*.t'; - -build_requires 'Test::More'; -use_test_base; -auto_include; -#auto_include_deps; -author_tests 'xt'; -auto_set_repository; -WriteAll; diff --git a/README b/README deleted file mode 100644 index 52cd616..0000000 --- a/README +++ /dev/null @@ -1,36 +0,0 @@ -NAME - Dancer::Logger::PSGI - PSGI logger handler for Dancer - -SYNOPSIS - In your Dancer's configuration file: - - logger: PSGI - - In your application - - warning "this is a warning" - - In your app.psgi - - $app = builder { enable "ConsoleLogger"; $app; } - - With Plack::Middleware::ConsoleLogger, all your log will be send to the - javascript console of your browser. - -DESCRIPTION - This class is an interface between your Dancer's application and - psgix.logger. Message will be logged in whatever logger you decided to - use in your Plack handler. If no logger is defined, nothing will be - logged. - -AUTHOR - franck cuny <franck@lumberjaph.net> - -SEE ALSO - Plack::Middleware::ConsoleLogger, Plack::Middleware::NullLogger, - Plack::Middleware::Log4perl. - -LICENSE - This library is free software; you can redistribute it and/or modify it - under the same terms as Perl itself. - diff --git a/dist.ini b/dist.ini new file mode 100644 index 0000000..b254461 --- /dev/null +++ b/dist.ini @@ -0,0 +1,28 @@ +name = Dancer-Logger-PSGI +author = franck cuny <franck@lumberjaph.net> +license = Perl_5 +copyright_holder = franck cuny +copyright_year = 2010 +version = 0.01 + +[@Git] +[@Filter] +bundle = @Basic + +[MetaConfig] +[MetaJSON] +[PkgVersion] +[PodSyntaxTests] +[PodCoverageTests] +[NoTabsTests] +[EOLTests] + +[MetaResources] +repository = git://github.com/franckcuny/dancer-logger-psgi.git +bugtracker = http://rt.cpan.org/Public/Dist/Display.html?Name=Dancer::Logger::PSGI +homepage = http://search.cpan.org/perldoc?Dancer::Logger::PSGI + +[PodWeaver] +[AutoPrereq] +[ReadmeFromPod] +[CheckChangeLog] diff --git a/lib/Dancer/Logger/PSGI.pm b/lib/Dancer/Logger/PSGI.pm index 797def4..9134e2b 100644 --- a/lib/Dancer/Logger/PSGI.pm +++ b/lib/Dancer/Logger/PSGI.pm @@ -1,7 +1,10 @@ package Dancer::Logger::PSGI; +# ABSTRACT: PSGI Log handler for Dancer + use strict; use warnings; + our $VERSION = '0.01'; use Dancer::SharedData; @@ -19,11 +22,6 @@ sub _log { } 1; -__END__ - -=head1 NAME - -Dancer::Logger::PSGI - PSGI logger handler for Dancer =head1 SYNOPSIS @@ -44,18 +42,3 @@ With L<Plack::Middleware::ConsoleLogger>, all your log will be send to the javas =head1 DESCRIPTION This class is an interface between your Dancer's application and B<psgix.logger>. Message will be logged in whatever logger you decided to use in your L<Plack> handler. If no logger is defined, nothing will be logged. - -=head1 AUTHOR - -franck cuny E<lt>franck@lumberjaph.netE<gt> - -=head1 SEE ALSO - -L<Plack::Middleware::ConsoleLogger>, L<Plack::Middleware::NullLogger>, L<Plack::Middleware::Log4perl>. - -=head1 LICENSE - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=cut diff --git a/t/01_basic.t b/t/01_basic.t index cd93d94..86de374 100644 --- a/t/01_basic.t +++ b/t/01_basic.t @@ -19,7 +19,7 @@ Test::TCP::test_tcp( my $request = HTTP::Request->new(GET => "http://127.0.0.1:$port/"); my $res = $ua->request($request); ok($res->is_success, "server responded"); - like($res->content, qr/this is a warning/, "log message send"); + like($res->content, qr/this is a warning/, "log message send"); }, server => sub { my $port = shift; @@ -30,11 +30,11 @@ Test::TCP::test_tcp( setting apphandler => 'PSGI'; setting port => $port; setting access_log => 0; - setting logger => "PSGI"; + setting logger => "PSGI"; get '/' => sub { warning "this is a warning"; - return "<html><body>this is a test</body></html>"; + return "<html><body>this is a test</body></html>"; }; my $app = sub { @@ -42,8 +42,8 @@ Test::TCP::test_tcp( my $request = Dancer::Request->new($env); Dancer->dance($request); }; - $app = builder { enable "ConsoleLogger"; $app }; - Plack::Loader->auto(port => $port)->run($app); + $app = builder { enable "ConsoleLogger"; $app }; + Plack::Loader->auto(port => $port)->run($app); }, ); |