
Chroniton::Messages - an event log for Chroniton

my $log = Chroniton::Messages->new(\*STDERR);
$log->message("/etc", "starting backup of /etc");
$log->debug("/etc", "descending into /etc");
$log->warning("/etc/shadow", "can't read /etc/shadow");
$log->error("foo", "can't backup foo: doesn't exist");
$log->add(Chroniton::Event-> ... );
my @errors = $log->retrieve("error");
my @logfile = $log->retrieve_all;

Creates an instance. Argument print is a reference to a filehandle to write each message to. If no filehandle is specified, messages are stored only.
level indicates what level of messages are printed:
undef means to print everything
"errors" means to only print errors
"warnings" means to print errors and warningsAdds a Chroniton::Message object to the log. Dies if the message isn't actually a message (i.e. can't set ID or query type).
Returns a list of all messages, sorted by their insertion order.
Returns a list of all messages of type type, not sorted.
Adds the respective type of message to the database. Chroniton::Message for the argument ordering, as these methods merely serve as a convenient way to write:
$log->add(Chroniton::Message->type(@_));
Returns a string summarizing the event log.
Logs an error, saves the logfile, and then dies (via confess), printing the error message to STDERR and all log entries to STDOUT.