Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

poe::component::irc::plugin::logger(3pm) [debian man page]

POE::Component::IRC::Plugin::Logger(3pm)		User Contributed Perl Documentation		  POE::Component::IRC::Plugin::Logger(3pm)

NAME
POE::Component::IRC::Plugin::Logger - A PoCo-IRC plugin which logs public, private, and DCC chat messages to disk SYNOPSIS
use POE::Component::IRC::Plugin::Logger; $irc->plugin_add('Logger', POE::Component::IRC::Plugin::Logger->new( Path => '/home/me/irclogs', DCC => 0, Private => 0, Public => 1, )); DESCRIPTION
POE::Component::IRC::Plugin::Logger is a POE::Component::IRC plugin. It logs messages and CTCP ACTIONs to either #some_channel.log or some_nickname.log in the supplied path. In the case of DCC chats, a '=' is prepended to the nickname (like in irssi). The plugin tries to detect UTF-8 encoding of every message or else falls back to CP1252, like irssi (and, supposedly, mIRC) does by default. Resulting log files will be UTF-8 encoded. The default log format is similar to xchat's, except that it's sane and parsable. This plugin requires the IRC component to be POE::Component::IRC::State or a subclass thereof. It also requires a POE::Component::IRC::Plugin::BotTraffic to be in the plugin pipeline. It will be added automatically if it is not present. METHODS
"new" Arguments: 'Path', the place where you want the logs saved. 'Private', whether or not to log private messages. Defaults to 1. 'Public', whether or not to log public messages. Defaults to 1. 'DCC', whether or not to log DCC chats. Defaults to 1. 'Notices', whether or not to log NOTICEs. Defaults to 0. 'Sort_by_date', whether or not to split log files by date, i.e. #channel/YYYY-MM-DD.log instead of #channel.log. If enabled, the date will be omitted from the timestamp. Defaults to 0. 'Strip_color', whether or not to strip all color codes from messages. Defaults to 0. 'Strip_formatting', whether or not to strip all formatting codes from messages. Defaults to 0. 'Restricted', set this to 1 if you want all directories/files to be created without read permissions for other users (i.e. 700 for dirs and 600 for files). Defaults to 1. 'Format', a hash reference representing the log format, if you want to define your own. See the source for details. 'Log_sub', a subroutine reference which can be used to override the file logging. Use this if you want to store logs in a database instead, for example. It will be called with 3 arguments: the context (a channel name or nickname), a type (e.g. 'privmsg' or '+b', and any arguments to that type. You can make use "default_format" to create logs that match the default log format. Note: You must take care of handling date/time and stripping colors/formatting codes yourself. Returns a plugin object suitable for feeding to POE::Component::IRC's "plugin_add" method. "default_format" Returns a hash reference of type/subroutine pairs, for formatting logs according to the default log format. AUTHOR
Hinrik Oern Sigur`sson, hinrik.sig@gmail.com perl v5.14.2 2011-12-07 POE::Component::IRC::Plugin::Logger(3pm)

Check Out this Related Man Page

POE::Component::IRC::Plugin::PlugMan(3pm)		User Contributed Perl Documentation		 POE::Component::IRC::Plugin::PlugMan(3pm)

NAME
POE::Component::IRC::Plugin::PlugMan - A PoCo-IRC plugin that provides plugin management services. SYNOPSIS
use strict; use warnings; use POE qw(Component::IRC::State); use POE::Component::IRC::Plugin::PlugMan; my $botowner = 'somebody!*@somehost.com'; my $irc = POE::Component::IRC::State->spawn(); POE::Session->create( package_states => [ main => [ qw(_start irc_plugin_add) ], ], ); sub _start { $irc->yield( register => 'all' ); $irc->plugin_add( 'PlugMan' => POE::Component::IRC::Plugin::PlugMan->new( botowner => $botowner ) ); return; } sub irc_plugin_add { my ($desc, $plugin) = @_[ARG0, ARG1]; if ($desc eq 'PlugMan') { $plugin->load( 'Connector', 'POE::Component::IRC::Plugin::Connector' ); } return; } DESCRIPTION
POE::Component::IRC::Plugin::PlugMan is a POE::Component::IRC plugin management plugin. It provides support for 'on-the-fly' loading, reloading and unloading of plugin modules, via object methods that you can incorporate into your own code and a handy IRC interface. METHODS
"new" Takes two optional arguments: 'botowner', an IRC mask to match against for people issuing commands via the IRC interface; 'auth_sub', a sub reference which will be called to determine if a user may issue commands via the IRC interface. Overrides 'botowner'. It will be called with three arguments: the IRC component object, the nick!user@host and the channel name as arguments. It should return a true value if the user is authorized, a false one otherwise. 'debug', set to a true value to see when stuff goes wrong; Not setting 'botowner' or 'auth_sub' effectively disables the IRC interface. If 'botowner' is specified the plugin checks that it is being loaded into a POE::Component::IRC::State or sub-class and will fail to load otherwise. Returns a plugin object suitable for feeding to POE::Component::IRC's "plugin_add" method. "load" Loads a managed plugin. Takes two mandatory arguments, a plugin descriptor and a plugin package name. Any other arguments are used as options to the loaded plugin constructor. $plugin->load( 'Connector', 'POE::Component::IRC::Plugin::Connector', delay, 120 ); Returns true or false depending on whether the load was successfully or not. "unload" Unloads a managed plugin. Takes one mandatory argument, a plugin descriptor. $plugin->unload( 'Connector' ); Returns true or false depending on whether the unload was successfully or not. "reload" Unloads and loads a managed plugin, with applicable plugin options. Takes one mandatory argument, a plugin descriptor. $plugin->reload( 'Connector' ); "loaded" Takes no arguments. $plugin->loaded(); Returns a list of descriptors of managed plugins. INPUT
An IRC interface is enabled by specifying a "botowner" mask to "new". Commands may be either invoked via a PRIVMSG directly to your bot or in a channel by prefixing the command with the nickname of your bot. One caveat, the parsing of the irc command is very rudimentary (it merely splits the line on spaces). "plugin_add" Takes the same arguments as "load". "plugin_del" Takes the same arguments as "unload". "plugin_reload" Takes the same arguments as "reload". "plugin_loaded" Returns a list of descriptors of managed plugins. "plugin_list" Returns a list of descriptors of *all* plugins loaded into the current PoCo-IRC component. AUTHOR
Chris 'BinGOs' Williams SEE ALSO
POE::Component::IRC::State POE::Component::IRC::Plugin perl v5.14.2 2011-12-07 POE::Component::IRC::Plugin::PlugMan(3pm)
Man Page