Dominique Dumont > Log-Dispatch-Tk-1.7 > Log::Dispatch::ToTk

Download:
Log-Dispatch-Tk-1.7.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.006   Source  

NAME ^

Log::Dispatch::ToTk - Class to redirect Log::Dispatch to Tk widgets

SYNOPSIS ^

 # Log::Dispatch::ToTk must be used in a composite widget

 Tk::Widget->Construct('LogText');

 sub InitObject
  {
    my ($dw,$args) = @_ ;
    
    # retrieve parameters specific to Log::Dispatch::*
    my %params ;
    foreach my $key (qw/name min_level max_level/)
      {
        $params{$key} = delete $args->{$key} 
           if defined $args->{$key};
      } 
    
    # create the TkTk buddy class
    $dw->{logger} = Log::Dispatch::ToTk->
      new(%params, widget => $dw) ;

    # initiaze the widget
    $dw->SUPER::InitObject($args) ;
  }

 # mandatory method in Tk widget using Log::Dispatch::ToTk
 sub logger
  {
    my $dw = shift;
    return $dw->{logger} ;
  }

__END__

DESCRIPTION ^

Most users will only need to use Log::Dispatch::TkText widget to have Log::Dispatch messages written on a text widget.

For more fancy uses, this module can be used by a composite widget dedicated to handle Log::Dispatch logs.

This module is the interface class between Log::Dispatch and Tk widgets. This class is derived from Log::Dispatch::Output.

One ToTk object will be created for each Log::Dispatch::Tk* widget and the user must register the ToTk object to the log dispatcher.

METHODS ^

new(...)

Create a new ToTk object. Parameter are :

log_message( level => $, message => $ )

Sends a message if the level is greater than or equal to the object's minimum level.

AUTHOR ^

Dominique Dumont <Dominique.Dumont@hp.com> using Log::Dispatch and Log::Dispatch::Output from Dave Rolsky, autarch@urth.org

Copyright (c) 2000, 2003 Hewlett-Packard Company. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

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::TkText

syntax highlighting: