Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mar-kolya/timed-logger-dancer-adoptplack


https://github.com/mar-kolya/timed-logger-dancer-adoptplack

Last synced: 4 days ago
JSON representation

Awesome Lists containing this project

README

        

package Timed::Logger::Dancer::AdoptPlack;

use 5.16.0;
use strict;
use warnings;

use Moose;
use Plack::Middleware::Timed::Logger;
use Dancer qw();

=head1 NAME

Timed::Logger::Dancer::AdoptPlack - Use Plack Timed::Logger Middleware with Dancer

=head1 VERSION

Version 0.0.5

=cut

our $VERSION = '0.0.5';

=head1 SYNOPSIS

use Timed::Logger::Dancer::AdoptPlack;

my $logger = Timed::Logger::Dancer::AdoptPlack->logger;
my $log_entry = $logger->start('DB');
...

=head1 DESCRIPTION

This module bridges L middleware L with
L application. It provides method of getting and instance of L
to log events. Those events can be later displayed by L
debug panel.

This module was inspired by L.

=head1 SUBROUTINES

=head2 logger

Static method to get a L instance.

=cut

sub logger {
my $request = Dancer->request;
return Plack::Middleware::Timed::Logger->get_logger_from_env($request ? $request->env : {});
}

=head1 SEE ALSO

L, L,
L, L

=head1 AUTHOR

Nikolay Martynov, C<< >>

=head1 BUGS

Please report any bugs or feature requests to C, or through
the web interface at L.
I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Timed::Logger::Dancer::AdoptPlack

You can also look for information at:

=over 4

=item * RT: CPAN's request tracker (report bugs here)

L

=item * AnnoCPAN: Annotated CPAN documentation

L

=item * CPAN Ratings

L

=item * Search CPAN

L

=back

=head1 ACKNOWLEDGEMENTS

Logan Bell and Belden Lyman.

=head1 LICENSE AND COPYRIGHT

Copyright 2013 Nikolay Martynov and Shutterstock Inc (http://shutterstock.com). All rights reserved.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See L for more information.

=cut

1; # End of Timed::Logger::Dancer::AdoptPlack