NAME
Log::Dispatch::TkText - Text widget for Log::Dispatch
SYNOPSIS
use Tk ;
use Log::Dispatch;
use Log::Dispatch::TkText ;
my $dispatch = Log::Dispatch->new;
my $mw = MainWindow-> new ;
my $tklog = $mw->Scrolled(
'LogText',
name => 'tk',
min_level => 'debug',
hide_label => 1 , # optional
);
$tklog -> pack ;
# add the logger object to $dispatch (not the widget !!)
$dispatch->add($tklog->logger) ;
$dispatch -> log
(
level => 'info',
message => "Quaquacomekiki ? (so says Averell Dalton)"
) ;
DESCRIPTION
This widget provide a read-only text widget (based on Tk::ROText) for logging through the Log::Dispatch module.
Note that this widget works with a buddy Log::Dispatch::ToTk object which will be created by the widget's constructor. The reference to this buddy object must be added to the main log dispatcher.
Parameters
hide_label
By default, log levels are shown in the widget. You can set this parameter to one to hide them.
Filters
By clicking on <button-3> within the text widget, you get access to a filter menu which can hide specific levels of logging.
For instance if you text widget is cluttered with 'info' message and you are looking for only 'error' messages, you can hide all 'info' messages by disabling the 'info' level in the Filter menu so only the 'error' messages will be left on the screen.
Note that the filter hides the text. They can be displaying again if you switch back the 'info' level in the Filter menu.
METHODS
The following methods were added to the Tk::ROText widget:
logger()
Returns the buddy ToTk object.
log_message( level => $, message => $ )
Sends a message if the level is greater than or equal to the object's minimum level.
AUTHOR
Dominique Dumont <ddumont@cpan.org> using Log::Dispatch from Dave Rolsky, <autarch@urth.org>
Copyright (c) 2000-2004, 2017 Dominique Dumont This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
CONTRIBUTORS
Tom McMeekin
SEE ALSO
Log::Dispatch, Log::Dispatch::Email, Log::Dispatch::Email::MailSend, Log::Dispatch::Email::MailSendmail, Log::Dispatch::Email::MIMELite, Log::Dispatch::File, Log::Dispatch::Handle, Log::Dispatch::Screen, Log::Dispatch::Syslog, Log::Dispatch::ToTk