Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.546.924 Times

PerlIO::via::Logger 1.01

  Date Added: January 18, 2010  |  Visits: 693

PerlIO::via::Logger

Report Broken Link
Printer Friendly Version


Product Homepage
Download (73 downloads)



PerlIO::via::Logger is a PerlIO layer for prefixing current time to log output. SYNOPSIS use PerlIO::via::Logger; PerlIO::via::Logger->format( [%b %d, %Y %r] ); use PerlIO::via::Logger format => [%b %d, %Y %r] ; open( my $in,<:via(Logger),filein ) or die "Cant open file.ln for reading: $!n"; open( my $out,>:via(Logger),fileout ) or die "Cant open file.ln for writing: $!n"; PerlIO::via::Logger::logify(*STDOUT); # redirect stdout in one line! PerlIO::via::Logger::logify(*openhandle); # or any other handle This module implements a PerlIO layer that prefixes the current time to each line of output or input. This module was created because I frequently need to use file logging systems in daemon-style Perl systems. This module was created to fulfill three requirements: 1. Must be low overhead/fast 2. Must be simple to use (i.e. print "something to logn") 3. Must be able to add a prefix to each line (times in my case) CLASS METHODS The following two class methods allow you to alter the prefix formatting string used by the I/O layer and to redirect existing filehandles with (almost) no effort. For convienance, class methods can also be called as key-value pairs in the use statement. This allows you to use this module in an "import and forget it" fashion. Please note that the new value of the class methods that are specified, only apply to the file handles that are opened (or to which the layer is assigned using binmode()) after they have been changed. format use PerlIO::via::Logger format => [%b %d, %Y %r] ; PerlIO::via::Logger->format( [%b %d, %Y %r] ); my $format = PerlIO::via::Logger->format; The class method format returns the format that will be used for adding the time to lines. The optional input parameter specifies the format that will be used for any files that are opened in the future. You should use only the conversion specifiers defined by the ANSI C standard (C89, to play safe). These are aAbBcdHIjmMpSUwWxXyYZ% . The default is [%b %d, %Y %H:%M:%S] , though the examples throughout this document use a more elegant - but less portable - format. logify PerlIO::via::Logger::logify( $filehandle ); PerlIO::via::Logger::logify( *WRITEFH ); PerlIO::via::Logger::logify( *STDOUT ); The class method logify exists purely for convenience and my personal use. I do not recommend using it unless your systems are for development only, or you understand how it works. In short it will reopen the given filehandle through the Logger I/O layer..

Requirements: No special requirements
Platforms: Linux
Keyword: Class Class Methods Current Current Time Format Layer Libraries Perlio Layer Perliovialogger Programming Time
Users rating: 0/10

License: Freeware Size: 6.14 KB
USER REVIEWS
More Reviews or Write Review


PERLIO::VIA::LOGGER RELATED
Libraries  -  Time::Format 1.02
Time::Format is a Perl module for easy-to-use date/time formatting. SYNOPSIS use Time::Format qw(%time %strftime %manip); $time{$format} $time{$format, $unixtime} print "Today is $time{yyyy/mm/dd}n"; print "Yesterday was...
38.91 KB  
Libraries  -  PerlIO::locale 0.03
PerlIO::locale is a PerlIO layer to use the encoding of the current locale. SYNOPSIS use PerlIO::locale; open my $filehandle, <:locale, $filename or die $!; This is mostly a per-filehandle version of the open pragma, when used under the...
3.07 KB  
Time & Clock Tools  -  Eusing Clock 2.5
Even though the current time and date can be checked from your system's calendar which is located in the system tray, this calendar cannot be customized and personalized. Eusing Clock is a small desktop clock application that will place a great...
295 KB  
Network & Internet  -  xajax 0.5 Beta 3
xajax project is an open source PHP class library for easily creating powerful PHP-driven, web-based AJAX Applications. Using xajax, you can asynchronously call PHP functions and update the content of your webpage without reloading the page....
68.61 KB  
Libraries  -  Games::Euchre::Trick 1.02
Games::Euchre::Trick is a trick class for Euchre card game. Only one Trick instance is alive at one time per Euchre game. The Trick keeps track of which cards have been played, and provides useful functions to determine which cards are legal...
21.5 KB  
Libraries  -  Class::Maker 0.05.18
Class::Maker Perl module contains classes, reflection, schema, serialization, attribute- and multiple inheritance. SYNOPSIS use Class::Maker qw(class); class Human, { isa => [qw( ParentClass )], public => { string => [qw(name lastname)],...
49.15 KB  
Development Tools  -  XML Check for XML Tools 1.0
This class implements methods to check if a URL or file is well-formed XML.If not the class supplies methods to return the error message, line number and column number. If the source is well-formed the class provides methods to return the number...
10 KB  
Productivity  -  Time Difference Calc. 1.1.0.2
This application calculates the difference between the two times. It supports both AM+PM and 24 Hr time format. It can optionally have resolution of seconds. User can enter the current time by pressing now button. Please rate my app and check...
1024 KB  
Libraries  -  Time::Elapse 1.2402
Time::Elapse is a Perl extension for monitoring time conveniently during tasks. Time::Elapse is a very simple class with one method: lapse. Basically, the lapse method eats the brains of the variable, squirrels away whatever value it may have...
7.17 KB  
Utilities  -  PVMS Mobile 1.0.0
PVMS Mobile is a feature rich enterprise-class video management software platform that provides the user with access to real-time video surveillance from any network enabled workstation. The client version of PVMS can be accessed via user-...
4.8 MB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB