Gaim::Log::Parser - Parse Gaim's Log Files


    use Gaim::Log::Parser;

    my $parser = Gaim::Log::Parser->new(file => $filename);

    while(my $msg = $parser->next_message()) {
        print $msg->as_string();


Gaim::Log::Parser parses Gaim/Pidgin's log files. In the 1.4+ series, they are organized in the following way:


Make sure that your Gaim/Pidgin client has logging turned on and that the logging format is set to 'text' (not html). If you have log files in html format already, run the utility eg/gaimlog-html2text to make text format copies of existing html logs.


my $parser = Gaim::Log::Parser-new(file => $filename)>

Create a new log parser.

The parser will interpret the message time stamps according to a selected time zone.

By default, the time zone is assumed to be 'local' which will try all kinds of tricks to determine the local time zone. If this is not what you want, a time zone for DateTime::TimeZone can be provided, e.g. "America/Los_Angeles".

my $msg = $parser->next_message()

Return the next message in the log. Returns an object of type Gaim::Log::Message. Check its documentation for details.

my $dt = $parser->datetime()

Retrieve the DateTime object used internally by Gaim::Log::Parser. Can be used to obtain the the start date of the parsed log file or the time zone used.


Position the parser back to the beginning of the conversation. After this has been completed, the next next_message() will return the first message in the log file.

my $str = $parser->as_string()

Return the entire conversation as a nicely formatted text string. By default, Text::Wrap's column with lines will be set to 70, if you prefer a different width, specify it explicitely

    my $str = $parser->as_string( {columns => 30} );


Gaim::Log::Finder, Gaim::Log::Message in this distribution


Copyright 2005-2008 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.


Mike Schilli <>

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 371:

You forgot a '=back' before '=head1'

Around line 375:

=back without =over