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 32.387.651 Times

PerlIO::via::Logger 1.01

  Date Added: January 18, 2010  |  Visits: 719

PerlIO::via::Logger

Report Broken Link
Printer Friendly Version


Product Homepage
Download (76 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  
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  
Libraries  -  Myco::Entity 1.22
Myco::Entity is a common base class for all Myco entity classes. SYNOPSIS ### Entity class definition package Myco::Foo; use base qw(Myco::Entity); # Start building metadata my $metadata = Myco::Entity::Meta->new ( name => __PACKAGE__,...
102.4 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
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  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 3.15.3
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
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