From: Tom Cloyd Date: 2009-05-06T11:34:37+09:00 Subject: Re: my logroll code, please critique Derek Smith wrote: > Joel VanderWerf wrote: > >> Derek Smith wrote: >> >>> Will anyone share good sample code for logging? >>> >> There's the logger.rb in the ruby standard library (or did someone >> mention that already?). It handles rotation, log levels, but perhaps not >> multiprocess safety. >> > > Here is my updated code, but how do I look at the documentation from the > CLI for logger, logging or any gem? For example, if I want to look at > Perl docs I use perldoc -f "builtin function" or perldoc -q "F.A.Q." > Finally, what about a central logging block for when at anytime 'raise > StandardError' is called, the script will log to one logfile. Will > anyone suggest code or how to do this? > > More on finding documentation - I can't help you if you're on a Winxxxx system, but on my Kubuntu Linux OS I can find useful documentation for the "logger" standard library member (and others) by issuing at my CLI - which logger I get a pile of locations on the filesys where "logger" appears. Many are irrelevant, but this one is not: /usr/share/doc/ruby1.8-examples/examples/logger There I find 3 ruby code files illustrating library use. Nice. (I didn't know about this until I set out to find an answer to your question, so thanks to you for that.) t. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist Bellingham, Washington, U.S.A: (360) 920-1226 << tc@tomcloyd.com >> (email) << TomCloyd.com >> (website) << sleightmind.wordpress.com >> (mental health weblog) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~