WWW::Giraffi::API::AppLog - Giraffi API AppLog Method Module
0.13_02
use strict; use warnings; use WWW::Giraffi::API; my $apikey = "ilovenirvana_ilovekurtcobain"; my $g = WWW::Giraffi::API->new(apikey => $apikey); # get applog my $conditions = { type => "app" }; my $arrayref = $g->applog->search($conditions); foreach $ref(@{$arrayref}) { ## anything to do... }
Get All AppLog
Example:
$ create applog object my $applog = $g->applog; my $arrayref = $applog->all;
Return Array Reference:
[ applog => { 'level' => 'info', 'time' => '1326942906', 'type' => 'app', 'id' => '4f178abb2325b42dc7000002', 'message' => 'hello world' } ]
unix timestamp will be changed into Time::Piece Object.
$applog->use_time_piece(1); my $arrayref = $applog->all; # time is Time::Piece Object [ { applog => { 'level' => 'info', 'time' => bless( [ 32, 16, 12, 19, 0, '112', 4, 18, 0, '1326942992', 1 ], 'Time::Piece' ), 'type' => 'app', 'id' => '4f178b122325b42dd9000001', 'message' => 'hello world yaho' } } ]
Get AppLog by conditions
my $moniringdata = $g->applog; my $contidions = { level => "info" }; my $arrayref = $applog->search($conditions);
$applog->use_time_piece(1); my $arrayref = $applog->search($conditions);
Post AppLog
my $conditions = { type => "poppo", level => "info", time => time, message => "poppoppo", }; $g->applog->create($conditions);
Akira Horimoto <emperor@gmail.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WWW::Giraffi::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Giraffi::API
CPAN shell
perl -MCPAN -e shell install WWW::Giraffi::API
For more information on module installation, please visit the detailed CPAN module installation guide.