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

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

Serving Software Downloads in 956 Categories, Downloaded 50.244.428 Times

PerlIO::via::Logger 1.01

  Date Added: January 18, 2010  |  Visits: 1.019

PerlIO::via::Logger

Report Broken Link
Printer Friendly Version


Product Homepage
Download (99 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
Miscellaneous  -  Static or Class Methods 1.0
This script implements class methods that do not require an object instance.
 
Libraries  -  Rose::Class::MakeMethods::Set 0.84
Rose::Class::MakeMethods::Set is a Perl module to create class methods to manage sets. SYNOPSIS package MyClass; use Rose::Class::MakeMethods::Set ( inheritable_set => [ required_name => { add_implies => add_valid_name, test_method =>...
28.67 KB  
Desktop Utilities  -  Pywmdatetime 0.1.3
Pywmdatetime displays the current time, date, week day and week number. It is written using Python. Pywmdatetimes colors and formats are highly customizable. Invoke the program with --help or see the sample rc-file for more information. Why>...
5.12 KB  
Networking Tools  -  ICMPInfo 0.2
ICMPInfo is a tool that uses ICMP type 13 and 17 to retrieve the current time of a remote host and its netmask.. Luigi Auriemma
17.41 KB  
Shell & Desktop  -  Edastro 0.5
Edastro places ever changing astrology charts for current time on your desktop. The package contains 8 themes: -2 (a black and a white) standard wheel charts -2 standard wheel charts with hourglass look effect -2 aspect/midpoint grids -2...
419.84 KB  
Miscellaneous  -  Classmethod emulation in python2.1 1.1
Class methods were introduced in python2.2. This script illustrates how the same effect can be achieved in python 2.1.
 
Desktop Toolbars  -  LED Clock GT-7 1.0
Transparent gadget that displays the current time like LED board. You can change color of font, set on/off shadow and AM/PM mode.
319.17 KB  
Libraries  -  DateTime::Format::Builder::Tutorial 0.7807
DateTime::Format::Builder::Tutorial is a quick class on using Builder. CREATING A CLASS As most people who are writing modules know, you start a package with a package declaration and some indication of module version: package...
48.13 KB  
Modules  -  Display Time(zone) 1.0.2
Display Timezone is simple plug-in to display current time with timezone in the upper right of your admin screen on every page. It takes the values from the option Timezone, Date Format, Time Format and starts the clock. There is no configuration...
20.48 KB  
Programming  -  Time::UTC::Now 0.003
Time::UTC::Now is a Perl module to determine current time in UTC correctly. SYNOPSIS use Time::UTC::Now qw(now_utc_rat now_utc_sna now_utc_flt); ($day, $secs, $bound) = now_utc_rat; ($day, $secs, $bound) =...
10.24 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 4.0.0
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