radiantmatrix,
I like it, but here is a wish list:
* Default log file permissions 666. Setting umask in the main program
doesn't seem to affect the log file permissions, not sure why.
* strftime string configurable. ISO 8601 be damned, the 'T' between
date and time is annoying.
* PID logged instead of sequence number. This would allow me to unravel
multiple simultaneous runs of the program. The sequence numbers can be
derived later by the log parser.
* Record $0 and @ARGV in the 'Logging started' message.
* Line header shorter. Golf it a bit to leave more space for the good
stuff. The colons do nothing for me and a single character T, D, I, W, X is
as good as TRCE, DBUG, INFO, WARN, XCPT. How about:
20060217 155643 12345 I Logging started ./tryl -this -that other
20060217 155643 12345 W hello at ./tryl line 8.
20060217 155643 12345 I this is an information statement
20060217 155643 12345 X Game over, man: game over! at ./tryl line 12.
instead of:
2006-02-17T15:56:43 0: INFO: Logging started
2006-02-17T15:56:43 1: WARN: hello at ./tryl line 8.
2006-02-17T15:56:43 2: INFO: this is an information statement
2006-02-17T15:56:43 3: XCPT: Game over, man: game over! at ./tryl
+ line 12.
LogFoo
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.