NAME

WWW::Giraffi::API::AppLog - Giraffi API AppLog Method Module

VERSION

0.13_03

SYNOPSIS

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...
}

DESCRIPTION

WWW::Giraffi::API::AppLog - Giraffi API AppLog Method Module

METHOD

all

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.

Example:

$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

Example:

my $moniringdata = $g->applog;
my $contidions = { level => "info" };
my $arrayref = $applog->search($conditions);

Return Array Reference:

[
  applog => {
          'level' => 'info',
          'time' => '1326942906',
          'type' => 'app',
          'id' => '4f178abb2325b42dc7000002',
          'message' => 'hello world'
   }
]

unix timestamp will be changed into Time::Piece Object.

Example:

$applog->use_time_piece(1);
my $arrayref = $applog->search($conditions);

create

Post AppLog

Example:

my $conditions = {
      type => "poppo",
      level => "info",
      time => time,
      message => "poppoppo",
   };
$g->applog->create($conditions);

AUTHOR

Akira Horimoto <emperor@gmail.com>

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.