ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- formatter-i.ri000064400000002031152351327600007331 0ustar00U:RDoc::Attr[iI"formatter:ETI"Logger#formatter;TI"RW;T: publico:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [I"FLogging formatter, as a +Proc+ that will take four arguments and ;TI"5return the formatted message. The arguments are:;To:RDoc::Markup::BlankLineo:RDoc::Markup::List: @type: NOTE: @items[ o:RDoc::Markup::ListItem: @label[I"+severity+;T; [o; ; [I"%The Severity of the log message.;To;;[I" +time+;T; [o; ; [I">A Time instance representing when the message was logged.;To;;[I"+progname+;T; [o; ; [I">The #progname configured, or passed to the logger method.;To;;[I" +msg+;T; [o; ; [I"HThe _Object_ the user passed to the log message; not necessarily a ;TI" String.;T@o; ; [I"JThe block should return an Object that can be written to the logging ;TI"Mdevice via +write+. The default formatter is used when no formatter is ;TI" set.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0F@5I" Logger;TcRDoc::NormalClass0sev_threshold-i.ri000064400000000503152351327600010201 0ustar00U:RDoc::Attr[iI"sev_threshold:EFI"Logger#sev_threshold;TI"RW;T: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"=Logging severity threshold (e.g. Logger::INFO).;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0F@I" Logger;TcRDoc::NormalClass0LogDevice/shift_log_age-i.ri000064400000000377152351327600011774 0ustar00U:RDoc::AnyMethod[iI"shift_log_age:EFI"$Logger::LogDevice#shift_log_age;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"LogDevice;TcRDoc::NormalClass00LogDevice/check_shift_log-i.ri000064400000000403152351327600012303 0ustar00U:RDoc::AnyMethod[iI"check_shift_log:EFI"&Logger::LogDevice#check_shift_log;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"LogDevice;TcRDoc::NormalClass00LogDevice/cdesc-LogDevice.ri000064400000001561152351327600011670 0ustar00U:RDoc::NormalClass[iI"LogDevice:ETI"Logger::LogDevice;TI" Object;To:RDoc::Markup::Document: @parts[o;;[o:RDoc::Markup::Paragraph;[I"&Device used for logging messages.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0; 0; 0[[ I"dev;TI"R;T: publicFI"lib/logger.rb;T[ I" filename;TI"R;T; F@[U:RDoc::Constant[iI"SiD;FI"Logger::LogDevice::SiD;T00o;;[; @; 0@@cRDoc::NormalClass0[[[I" class;T[[; [[I"new;T@[:protected[[: private[[I" instance;T[[; [[I" close;F@[I" write;F@[;[[;[[I"add_log_header;F@[I"check_shift_log;F@[I"create_logfile;F@[I"eod;F@[I"lock_shift_log;F@[I"open_logfile;F@[I"previous_period_end;F@[I"shift_log_age;F@[I"shift_log_period;F@[[U:RDoc::Context::Section[i0o;;[; 0; 0[@I" Logger;T@!LogDevice/add_log_header-i.ri000064400000000405152351327600012073 0ustar00U:RDoc::AnyMethod[iI"add_log_header:EFI"%Logger::LogDevice#add_log_header;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I" (file);T@ FI"LogDevice;TcRDoc::NormalClass00LogDevice/reopen-i.ri000064400000000405152351327600010462 0ustar00U:RDoc::AnyMethod[iI" reopen:ETI"Logger::LogDevice#reopen;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger/log_device.rb;T:0@omit_headings_from_table_of_contents_below000[I"(log = nil);T@ FI"LogDevice;TcRDoc::NormalClass00LogDevice/new-c.ri000064400000000376152351327600007764 0ustar00U:RDoc::AnyMethod[iI"new:ETI"Logger::LogDevice::new;TT: publico:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(log = nil, opt = {});T@ FI"LogDevice;TcRDoc::NormalClass00LogDevice/shift_log_period-i.ri000064400000000417152351327600012515 0ustar00U:RDoc::AnyMethod[iI"shift_log_period:EFI"'Logger::LogDevice#shift_log_period;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(period_end);T@ FI"LogDevice;TcRDoc::NormalClass00LogDevice/close-i.ri000064400000000356152351327600010304 0ustar00U:RDoc::AnyMethod[iI" close:EFI"Logger::LogDevice#close;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"LogDevice;TcRDoc::NormalClass00LogDevice/filename-i.ri000064400000000360152351327600010752 0ustar00U:RDoc::Attr[iI" filename:ETI"Logger::LogDevice#filename;TI"R;T: publico:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0F@ I"Logger::LogDevice;TcRDoc::NormalClass0LogDevice/create_logfile-i.ri000064400000000411152351327600012133 0ustar00U:RDoc::AnyMethod[iI"create_logfile:EFI"%Logger::LogDevice#create_logfile;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(filename);T@ FI"LogDevice;TcRDoc::NormalClass00LogDevice/write-i.ri000064400000000365152351327600010331 0ustar00U:RDoc::AnyMethod[iI" write:EFI"Logger::LogDevice#write;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(message);T@ FI"LogDevice;TcRDoc::NormalClass00LogDevice/set_dev-i.ri000064400000000401152351327600010617 0ustar00U:RDoc::AnyMethod[iI" set_dev:ETI"Logger::LogDevice#set_dev;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger/log_device.rb;T:0@omit_headings_from_table_of_contents_below000[I" (log);T@ FI"LogDevice;TcRDoc::NormalClass00LogDevice/open_logfile-i.ri000064400000000405152351327600011634 0ustar00U:RDoc::AnyMethod[iI"open_logfile:EFI"#Logger::LogDevice#open_logfile;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(filename);T@ FI"LogDevice;TcRDoc::NormalClass00LogDevice/dev-i.ri000064400000000346152351327600007754 0ustar00U:RDoc::Attr[iI"dev:ETI"Logger::LogDevice#dev;TI"R;T: publico:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0F@ I"Logger::LogDevice;TcRDoc::NormalClass0LogDevice/lock_shift_log-i.ri000064400000000407152351327600012162 0ustar00U:RDoc::AnyMethod[iI"lock_shift_log:EFI"%Logger::LogDevice#lock_shift_log;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below00I";T[I"();T@ FI"LogDevice;TcRDoc::NormalClass00fatal%3f-i.ri000064400000000551152351327600006720 0ustar00U:RDoc::AnyMethod[iI" fatal?:EFI"Logger#fatal?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"NReturns +true+ iff the current severity level allows for the printing of ;TI"+FATAL+ messages.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Logger;TcRDoc::NormalClass00cdesc-Logger.ri000064400000020426152351327600007406 0ustar00U:RDoc::NormalClass[iI" Logger:ET@I" Object;To:RDoc::Markup::Document: @parts[o;;[IS:RDoc::Markup::Heading: leveli: textI"Description;To:RDoc::Markup::BlankLineo:RDoc::Markup::Paragraph;[I"OThe Logger class provides a simple but sophisticated logging utility that ;TI"$you can use to output messages.;T@o; ;[I"RThe messages have associated levels, such as +INFO+ or +ERROR+ that indicate ;TI"Ptheir importance. You can then give the Logger a level, and only messages ;TI"-at that level or higher will be printed.;T@o; ;[I"The levels are:;T@o:RDoc::Markup::List: @type: NOTE: @items[ o:RDoc::Markup::ListItem: @label[I"+UNKNOWN+;T;[o; ;[I"5An unknown message that should always be logged.;To;;[I" +FATAL+;T;[o; ;[I";An unhandleable error that results in a program crash.;To;;[I" +ERROR+;T;[o; ;[I""A handleable error condition.;To;;[I" +WARN+;T;[o; ;[I"A warning.;To;;[I" +INFO+;T;[o; ;[I"9Generic (useful) information about system operation.;To;;[I" +DEBUG+;T;[o; ;[I"*Low-level information for developers.;T@o; ;[ I"KFor instance, in a production system, you may have your Logger set to ;TI"+INFO+ or even +WARN+. ;TI"?When you are developing the system, however, you probably ;TI"Rwant to know about the program's internal state, and would set the Logger to ;TI" +DEBUG+.;T@o; ;[I"K*Note*: Logger does not escape or sanitize any messages passed to it. ;TI"PDevelopers should be aware of when potentially malicious data (user-input) ;TI"Ais passed to Logger, and manually escape the untrusted data:;T@o:RDoc::Markup::Verbatim;[I".logger.info("User-input: #{input.dump}") ;TI"+logger.info("User-input: %p" % input) ;T: @format0o; ;[I"3You can use #formatter= for escaping all data.;T@o;;[ I"0original_formatter = Logger::Formatter.new ;TI"Clogger.formatter = proc { |severity, datetime, progname, msg| ;TI"G original_formatter.call(severity, datetime, progname, msg.dump) ;TI"} ;TI"logger.info(input) ;T;0S; ; i; I" Example;T@o; ;[I"NThis creates a Logger that outputs to the standard output stream, with a ;TI"level of +WARN+:;T@o;;[I"require 'logger' ;TI" ;TI"!logger = Logger.new(STDOUT) ;TI"!logger.level = Logger::WARN ;TI" ;TI"$logger.debug("Created logger") ;TI"$logger.info("Program started") ;TI"#logger.warn("Nothing to do!") ;TI" ;TI""path = "a_non_existent_file" ;TI" ;TI" begin ;TI"$ File.foreach(path) do |line| ;TI") unless line =~ /^(\w+) = (.*)$/ ;TI"? logger.error("Line in wrong format: #{line.chomp}") ;TI" end ;TI" end ;TI"rescue => err ;TI"1 logger.fatal("Caught exception; exiting") ;TI" logger.fatal(err) ;TI" end ;T;0o; ;[I"OBecause the Logger's level is set to +WARN+, only the warning, error, and ;TI"Lfatal messages are recorded. The debug and info messages are silently ;TI"discarded.;T@S; ; i; I" Features;T@o; ;[ I"GThere are several interesting features that Logger provides, like ;TI"Hauto-rolling of log files, setting the format of log messages, and ;TI"Rspecifying a program name in conjunction with the message. The next section ;TI"+shows you how to achieve these things.;T@S; ; i; I" HOWTOs;T@S; ; i; I"How to create a logger;T@o; ;[I"LThe options below give you various choices, in more or less increasing ;TI"complexity.;T@o;;: NUMBER;[ o;;0;[o; ;[I":Create a logger which logs messages to STDERR/STDOUT.;T@o;;[I"!logger = Logger.new(STDERR) ;TI"!logger = Logger.new(STDOUT) ;T;0o;;0;[o; ;[I"?Create a logger for the file which has the specified name.;T@o;;[I"(logger = Logger.new('logfile.log') ;T;0o;;0;[o; ;[I",Create a logger for the specified file.;T@o;;[ I">file = File.open('foo.log', File::WRONLY | File::APPEND) ;TI"H# To create new (and to remove old) logfile, add File::CREAT like: ;TI"N# file = File.open('foo.log', File::WRONLY | File::APPEND | File::CREAT) ;TI"logger = Logger.new(file) ;T;0o;;0;[o; ;[I"LCreate a logger which ages the logfile once it reaches a certain size. ;TI"GLeave 10 "old" log files where each file is about 1,024,000 bytes.;T@o;;[I"1logger = Logger.new('foo.log', 10, 1024000) ;T;0o;;0;[o; ;[I"ACreate a logger which ages the logfile daily/weekly/monthly.;T@o;;[I"-logger = Logger.new('foo.log', 'daily') ;TI".logger = Logger.new('foo.log', 'weekly') ;TI"/logger = Logger.new('foo.log', 'monthly') ;T;0S; ; i; I"How to log a message;T@o; ;[ I"ONotice the different methods (+fatal+, +error+, +info+) being used to log ;TI"Nmessages of various levels? Other methods in this family are +warn+ and ;TI"M+debug+. +add+ is used below to log a message of an arbitrary (perhaps ;TI"dynamic) level.;T@o;;;;[ o;;0;[o; ;[I"Message in a block.;T@o;;[I"2logger.fatal { "Argument 'foo' not given." } ;T;0o;;0;[o; ;[I"Message as a string.;T@o;;[I"/logger.error "Argument #{@foo} mismatch." ;T;0o;;0;[o; ;[I"With progname.;T@o;;[I"5logger.info('initialize') { "Initializing..." } ;T;0o;;0;[o; ;[I"With severity.;T@o;;[I"2logger.add(Logger::FATAL) { 'Fatal error!' } ;T;0o; ;[I"KThe block form allows you to create potentially complex log messages, ;TI"Cbut to delay their evaluation until and unless the message is ;TI"4logged. For example, if we have the following:;T@o;;[I"Jlogger.debug { "This is a " + potentially + " expensive operation" } ;T;0o; ;[I"RIf the logger's level is +INFO+ or higher, no debug messages will be logged, ;TI"Gand the entire block will not even be evaluated. Compare to this:;T@o;;[I"Glogger.debug("This is a " + potentially + " expensive operation") ;T;0o; ;[I"HHere, the string concatenation is done every time, even if the log ;TI"0level is not set to show the debug message.;T@S; ; i; I"How to close a logger;T@o;;[I"logger.close ;T;0S; ; i; I"Setting severity threshold;T@o;;;;[o;;0;[o; ;[I"Original interface.;T@o;;[I")logger.sev_threshold = Logger::WARN ;T;0o;;0;[o; ;[I"+Log4r (somewhat) compatible interface.;T@o;;[I"!logger.level = Logger::INFO ;TI" ;TI"5# DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN ;T;0S; ; i; I" Format;T@o; ;[I"KLog messages are rendered in the output stream in a certain format by ;TI"?default. The default format and a sample are shown below:;T@o; ;[I"Log format:;To;;[I"DSeverityID, [DateTime #pid] SeverityLabel -- ProgName: message ;T;0o; ;[I"Log sample:;To;;[I"AI, [1999-03-03T02:34:24.895701 #19074] INFO -- Main: info. ;T;0o; ;[I"CYou may change the date and time format via #datetime_format=.;T@o;;[I"2logger.datetime_format = '%Y-%m-%d %H:%M:%S' ;TI"( # e.g. "2004-01-03 00:54:26" ;T;0o; ;[I"FOr, you may change the overall format via the #formatter= method.;T@o;;[ I"Dlogger.formatter = proc do |severity, datetime, progname, msg| ;TI" "#{datetime}: #{msg}\n" ;TI" end ;TI"4# e.g. "2005-09-22 08:51:08 +0900: hello world";T;0: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[ [ I"formatter;TI"RW;T: publicFI"lib/logger.rb;T[ I" level;TI"RW;T;F@?[ I" progname;TI"RW;T;F@?[ I"sev_threshold;FI"RW;T;F@?[ I"sev_threshold=;FI"RW;T;F@?[U:RDoc::Constant[iI" VERSION;FI"Logger::VERSION;T00o;;[;@:;0@:@cRDoc::NormalClass0U;[iI" ProgName;FI"Logger::ProgName;T00o;;[;@:;0@:@@S0U;[iI"SEV_LABEL;FI"Logger::SEV_LABEL;T00o;;[o; ;[I".Severity label for logging (max 5 chars).;T;@:;0@:@@S0[[I" Severity;To;;[;@:;0@?[[I" class;T[[;[[I"new;T@?[:protected[[: private[[I" instance;T[[;[[I"<<;T@?[I"add;F@?[I" close;F@?[I"datetime_format;F@?[I"datetime_format=;F@?[I" debug;F@?[I" debug?;F@?[I" error;F@?[I" error?;F@?[I" fatal;F@?[I" fatal?;F@?[I" info;F@?[I" info?;F@?[I"log;F@?[I" unknown;F@?[I" warn;F@?[I" warn?;F@?[;[[;[[I"format_message;F@?[I"format_severity;F@?[[U:RDoc::Context::Section[i0o;;[;0;0[@:@:cRDoc::TopLevelwarn-i.ri000064400000000570152351327600006303 0ustar00U:RDoc::AnyMethod[iI" warn:EFI"Logger#warn;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Log a +WARN+ message.;To:RDoc::Markup::BlankLineo; ; [I"$See #info for more information.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(progname = nil, &block);T@FI" Logger;TcRDoc::NormalClass00reopen-i.ri000064400000001374152351327600006627 0ustar00U:RDoc::AnyMethod[iI" reopen:ETI"Logger#reopen;TF: privateo:RDoc::Markup::Document: @parts[ S:RDoc::Markup::Heading: leveli: textI" Args;To:RDoc::Markup::BlankLineo:RDoc::Markup::List: @type: NOTE: @items[o:RDoc::Markup::ListItem: @label[I" +logdev+;T; [o:RDoc::Markup::Paragraph; [I"JThe log device. This is a filename (String) or IO object (typically ;TI"H+STDOUT+, +STDERR+, or an open file). reopen the same filename if ;TI"7it is +nil+, do nothing for IO. Default is +nil+.;T@ S; ; i; I"Description;T@ o;; [I"Reopen a log device.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0I")Logger#reopen Logger#reopen(logdev) ;T0[I"(logdev = nil);T@FI" Logger;TcRDoc::NormalClass00Period/next_rotate_time-i.ri000064400000000425152351327600012127 0ustar00U:RDoc::AnyMethod[iI"next_rotate_time:ETI"$Logger::Period#next_rotate_time;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger/period.rb;T:0@omit_headings_from_table_of_contents_below000[I"(now, shift_age);T@ FI" Period;TcRDoc::NormalModule00Period/previous_period_end-i.ri000064400000000433152351327600012620 0ustar00U:RDoc::AnyMethod[iI"previous_period_end:ETI"'Logger::Period#previous_period_end;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger/period.rb;T:0@omit_headings_from_table_of_contents_below000[I"(now, shift_age);T@ FI" Period;TcRDoc::NormalModule00Period/cdesc-Period.ri000064400000001111152351327600010621 0ustar00U:RDoc::NormalModule[iI" Period:ETI"Logger::Period;T0o:RDoc::Markup::Document: @parts[o;;[: @fileI"lib/logger/period.rb;T:0@omit_headings_from_table_of_contents_below0; 0; 0[[U:RDoc::Constant[iI"SiD;TI"Logger::Period::SiD;T: public0o;;[; @ ; 0@ @cRDoc::NormalModule0[[[I" class;T[[; [[:protected[[: private[[I" instance;T[[; [[; [[;[[I"next_rotate_time;TI"lib/logger/period.rb;T[I"previous_period_end;T@-[[U:RDoc::Context::Section[i0o;;[; 0; 0[I"lib/logger/period.rb;TI" Logger;TcRDoc::NormalClassnew-c.ri000064400000001766152351327600006127 0ustar00U:RDoc::AnyMethod[iI"new:ETI"Logger::new;TT: publico:RDoc::Markup::Document: @parts[ S:RDoc::Markup::Heading: leveli: textI" Args;To:RDoc::Markup::BlankLineo:RDoc::Markup::List: @type: NOTE: @items[o:RDoc::Markup::ListItem: @label[I" +logdev+;T; [o:RDoc::Markup::Paragraph; [I"JThe log device. This is a filename (String) or IO object (typically ;TI"*+STDOUT+, +STDERR+, or an open file).;To;;[I"+shift_age+;T; [o;; [I"KNumber of old log files to keep, *or* frequency of rotation (+daily+, ;TI"+weekly+ or +monthly+).;To;;[I"+shift_size+;T; [o;; [I"FMaximum logfile size (only applies when +shift_age+ is a number).;T@ S; ; i; I"Description;T@ o;; [I"Create an instance.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0I"bLogger.new(name, shift_age = 7, shift_size = 1048576) Logger.new(name, shift_age = 'weekly') ;T0[I"2(logdev, shift_age = 0, shift_size = 1048576);T@,FI" Logger;TcRDoc::NormalClass00warn%21-i.ri000064400000000441152351327600006510 0ustar00U:RDoc::AnyMethod[iI" warn!:ETI"Logger#warn!;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Sets the severity to WARN.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Logger;TcRDoc::NormalClass00Formatter/format_datetime-i.ri000064400000000407152351327600012442 0ustar00U:RDoc::AnyMethod[iI"format_datetime:EFI"&Logger::Formatter#format_datetime;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I" (time);T@ FI"Formatter;TcRDoc::NormalClass00Formatter/new-c.ri000064400000000353152351327600010061 0ustar00U:RDoc::AnyMethod[iI"new:ETI"Logger::Formatter::new;TT: publico:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"Formatter;TcRDoc::NormalClass00Formatter/call-i.ri000064400000000411152351327600010204 0ustar00U:RDoc::AnyMethod[iI" call:EFI"Logger::Formatter#call;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"$(severity, time, progname, msg);T@ FI"Formatter;TcRDoc::NormalClass00Formatter/cdesc-Formatter.ri000064400000001250152351327600012067 0ustar00U:RDoc::NormalClass[iI"Formatter:ETI"Logger::Formatter;TI" Object;To:RDoc::Markup::Document: @parts[o;;[o:RDoc::Markup::Paragraph;[I"(Default formatter for log messages.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0; 0; 0[[ I"datetime_format;TI"RW;T: publicFI"lib/logger.rb;T[U:RDoc::Constant[iI" Format;FI"Logger::Formatter::Format;T00o;;[; @; 0@@cRDoc::NormalClass0[[[I" class;T[[; [[I"new;T@[:protected[[: private[[I" instance;T[[; [[I" call;F@[;[[;[[I"format_datetime;F@[I" msg2str;F@[[U:RDoc::Context::Section[i0o;;[; 0; 0[@I" Logger;T@Formatter/msg2str-i.ri000064400000000366152351327600010703 0ustar00U:RDoc::AnyMethod[iI" msg2str:EFI"Logger::Formatter#msg2str;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I" (msg);T@ FI"Formatter;TcRDoc::NormalClass00Formatter/datetime_format-i.ri000064400000000377152351327600012450 0ustar00U:RDoc::Attr[iI"datetime_format:ETI"&Logger::Formatter#datetime_format;TI"RW;T: publico:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0F@ I"Logger::Formatter;TcRDoc::NormalClass0fatal%21-i.ri000064400000000444152351327600006633 0ustar00U:RDoc::AnyMethod[iI" fatal!:ETI"Logger#fatal!;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I" Sets the severity to FATAL.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Logger;TcRDoc::NormalClass00warn%3f-i.ri000064400000000546152351327600006604 0ustar00U:RDoc::AnyMethod[iI" warn?:EFI"Logger#warn?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"NReturns +true+ iff the current severity level allows for the printing of ;TI"+WARN+ messages.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Logger;TcRDoc::NormalClass00debug%21-i.ri000064400000000444152351327600006632 0ustar00U:RDoc::AnyMethod[iI" debug!:ETI"Logger#debug!;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I" Sets the severity to DEBUG.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Logger;TcRDoc::NormalClass00close-i.ri000064400000000437152351327600006443 0ustar00U:RDoc::AnyMethod[iI" close:EFI"Logger#close;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Close the logging device.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Logger;TcRDoc::NormalClass00error%3f-i.ri000064400000000551152351327600006762 0ustar00U:RDoc::AnyMethod[iI" error?:EFI"Logger#error?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"NReturns +true+ iff the current severity level allows for the printing of ;TI"+ERROR+ messages.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Logger;TcRDoc::NormalClass00datetime_format%3d-i.ri000064400000001003152351327600010764 0ustar00U:RDoc::AnyMethod[iI"datetime_format=:EFI"Logger#datetime_format=;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Set date-time format.;To:RDoc::Markup::BlankLineo:RDoc::Markup::List: @type: NOTE: @items[o:RDoc::Markup::ListItem: @label[I"+datetime_format+;T; [o; ; [I"1A string suitable for passing to +strftime+.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(datetime_format);T@FI" Logger;TcRDoc::NormalClass00error-i.ri000064400000000574152351327600006471 0ustar00U:RDoc::AnyMethod[iI" error:EFI"Logger#error;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Log an +ERROR+ message.;To:RDoc::Markup::BlankLineo; ; [I"$See #info for more information.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(progname = nil, &block);T@FI" Logger;TcRDoc::NormalClass00unknown-i.ri000064400000000705152351327600007033 0ustar00U:RDoc::AnyMethod[iI" unknown:EFI"Logger#unknown;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"QLog an +UNKNOWN+ message. This will be printed no matter what the logger's ;TI"level is.;To:RDoc::Markup::BlankLineo; ; [I"$See #info for more information.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(progname = nil, &block);T@FI" Logger;TcRDoc::NormalClass00debug%3f-i.ri000064400000000551152351327600006717 0ustar00U:RDoc::AnyMethod[iI" debug?:EFI"Logger#debug?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"NReturns +true+ iff the current severity level allows for the printing of ;TI"+DEBUG+ messages.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Logger;TcRDoc::NormalClass00add-i.ri000064400000004005152351327600006061 0ustar00U:RDoc::AnyMethod[iI"add:EFI"Logger#add;TF: publico:RDoc::Markup::Document: @parts[S:RDoc::Markup::Heading: leveli: textI" Args;To:RDoc::Markup::BlankLineo:RDoc::Markup::List: @type: NOTE: @items[ o:RDoc::Markup::ListItem: @label[I"+severity+;T; [o:RDoc::Markup::Paragraph; [I"LSeverity. Constants are defined in Logger namespace: +DEBUG+, +INFO+, ;TI",+WARN+, +ERROR+, +FATAL+, or +UNKNOWN+.;To;;[I"+message+;T; [o;; [I"-The log message. A String or Exception.;To;;[I"+progname+;T; [o;; [I"GProgram name string. Can be omitted. Treated as a message if no ;TI"%+message+ and +block+ are given.;To;;[I" +block+;T; [o;; [I"ICan be omitted. Called to get a message string if +message+ is nil.;T@ S; ; i; I" Return;T@ o;; [I"NWhen the given severity is not high enough (for this particular logger), ;TI"'log no message, and return +true+.;T@ S; ; i; I"Description;T@ o;; [I"NLog a message if the given severity is high enough. This is the generic ;TI"Ologging method. Users will be more inclined to use #debug, #info, #warn, ;TI"#error, and #fatal.;T@ o;; [ I"JMessage format: +message+ can be any object, but it has to be ;TI"Mconverted to a String in order to log it. Generally, +inspect+ is used ;TI"*if the given object is not a String. ;TI"OA special case is an +Exception+ object, which will be printed in detail, ;TI"Dincluding message, class, and backtrace. See #msg2str for the ;TI" implementation if required.;T@ S; ; i; I" Bugs;T@ o;;: BULLET;[o;;0; [o;; [I"Logfile is not locked.;To;;0; [o;; [I",Append open does not need to lock file.;To;;0; [o;; [I"AIf the OS supports multi I/O, records possibly may be mixed.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0I"ALogger#add(severity, message = nil, progname = nil) { ... } ;TI";T[[I"log;Fo;; [;@V;0I".(severity, message = nil, progname = nil);T@VFI" Logger;TcRDoc::NormalClass00sev_threshold%3d-i.ri000064400000000505152351327600010477 0ustar00U:RDoc::Attr[iI"sev_threshold=:EFI"Logger#sev_threshold=;TI"RW;T: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"=Logging severity threshold (e.g. Logger::INFO).;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0F@I" Logger;TcRDoc::NormalClass0info-i.ri000064400000002732152351327600006271 0ustar00U:RDoc::AnyMethod[iI" info:EFI"Logger#info;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Log an +INFO+ message.;To:RDoc::Markup::BlankLineo:RDoc::Markup::List: @type: NOTE: @items[o:RDoc::Markup::ListItem: @label[I"+message+;T; [o; ; [I"6The message to log; does not need to be a String.;To;;[I"+progname+;T; [o; ; [I"Logger::INFO).;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0F@I" Logger;TcRDoc::NormalClass0info%21-i.ri000064400000000441152351327600006474 0ustar00U:RDoc::AnyMethod[iI" info!:ETI"Logger#info!;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Sets the severity to INFO.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Logger;TcRDoc::NormalClass00info%3f-i.ri000064400000000546152351327600006570 0ustar00U:RDoc::AnyMethod[iI" info?:EFI"Logger#info?;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"NReturns +true+ iff the current severity level allows for the printing of ;TI"+INFO+ messages.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Logger;TcRDoc::NormalClass00datetime_format-i.ri000064400000000524152351327600010477 0ustar00U:RDoc::AnyMethod[iI"datetime_format:EFI"Logger#datetime_format;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"?Returns the date format being used. See #datetime_format=;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Logger;TcRDoc::NormalClass00format_severity-i.ri000064400000000375152351327600010561 0ustar00U:RDoc::AnyMethod[iI"format_severity:EFI"Logger#format_severity;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(severity);T@ FI" Logger;TcRDoc::NormalClass00log-i.ri000064400000000421152351327600006110 0ustar00U:RDoc::AnyMethod[iI"log:EFI"Logger#log;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I".(severity, message = nil, progname = nil);T@ FI" Logger;TcRDoc::NormalClass0[@FI"add;Ferror%21-i.ri000064400000000444152351327600006675 0ustar00U:RDoc::AnyMethod[iI" error!:ETI"Logger#error!;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I" Sets the severity to ERROR.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI" Logger;TcRDoc::NormalClass00%3c%3c-i.ri000064400000000556152351327600006205 0ustar00U:RDoc::AnyMethod[iI"<<:ETI"Logger#<<;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"MDump given message to the log device without any formatting. If no log ;TI"!device exists, return +nil+.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I" (msg);T@FI" Logger;TcRDoc::NormalClass00level%3d-i.ri000064400000001006152351327600006732 0ustar00U:RDoc::AnyMethod[iI" level=:ETI"Logger#level=;TF: privateo:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"$Set logging severity threshold.;To:RDoc::Markup::BlankLineo:RDoc::Markup::List: @type: NOTE: @items[o:RDoc::Markup::ListItem: @label[I"+severity+;T; [o; ; [I"%The Severity of the log message.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[[I"sev_threshold=;To;; [;@;0I"(severity);T@FI" Logger;TcRDoc::NormalClass00Severity/cdesc-Severity.ri000064400000002314152351327600011607 0ustar00U:RDoc::NormalModule[iI" Severity:EFI"Logger::Severity;T0o:RDoc::Markup::Document: @parts[o;;[o:RDoc::Markup::Paragraph;[I"Logging severity.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0; 0; 0[[ U:RDoc::Constant[iI" DEBUG;FI"Logger::Severity::DEBUG;T00o;;[o; ;[I"2Low-level information, mostly for developers.;T; @; 0@@cRDoc::NormalModule0U; [iI" INFO;FI"Logger::Severity::INFO;T00o;;[o; ;[I"9Generic (useful) information about system operation.;T; @; 0@@@0U; [iI" WARN;FI"Logger::Severity::WARN;T00o;;[o; ;[I"A warning.;T; @; 0@@@0U; [iI" ERROR;FI"Logger::Severity::ERROR;T00o;;[o; ;[I""A handleable error condition.;T; @; 0@@@0U; [iI" FATAL;FI"Logger::Severity::FATAL;T00o;;[o; ;[I";An unhandleable error that results in a program crash.;T; @; 0@@@0U; [iI" UNKNOWN;FI"Logger::Severity::UNKNOWN;T00o;;[o; ;[I"5An unknown message that should always be logged.;T; @; 0@@@0[[[I" class;T[[: public[[:protected[[: private[[I" instance;T[[; [[;[[;[[[U:RDoc::Context::Section[i0o;;[; 0; 0[@I" Logger;TcRDoc::NormalClassfatal-i.ri000064400000000573152351327600006426 0ustar00U:RDoc::AnyMethod[iI" fatal:EFI"Logger#fatal;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Log a +FATAL+ message.;To:RDoc::Markup::BlankLineo; ; [I"$See #info for more information.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(progname = nil, &block);T@FI" Logger;TcRDoc::NormalClass00format_message-i.ri000064400000000424152351327600010326 0ustar00U:RDoc::AnyMethod[iI"format_message:EFI"Logger#format_message;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"((severity, datetime, progname, msg);T@ FI" Logger;TcRDoc::NormalClass00debug-i.ri000064400000000573152351327600006425 0ustar00U:RDoc::AnyMethod[iI" debug:EFI"Logger#debug;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"Log a +DEBUG+ message.;To:RDoc::Markup::BlankLineo; ; [I"$See #info for more information.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(progname = nil, &block);T@FI" Logger;TcRDoc::NormalClass00progname-i.ri000064400000000451152351327600007142 0ustar00U:RDoc::Attr[iI" progname:ETI"Logger#progname;TI"RW;T: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"-Program name to include in log messages.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0F@I" Logger;TcRDoc::NormalClass0LogDevice/LogDeviceMutex/cdesc-LogDeviceMutex.ri000064400000000734152376022770015607 0ustar00U:RDoc::NormalClass[iI"LogDeviceMutex:ETI"&Logger::LogDevice::LogDeviceMutex;TI" Object;To:RDoc::Markup::Document: @parts[o;;[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0; 0; 0[[[[I"MonitorMixin;To;;[; @; 0I"lib/logger.rb;T[[I" class;T[[: public[[:protected[[: private[[I" instance;T[[; [[; [[; [[[U:RDoc::Context::Section[i0o;;[; 0; 0[@I"Logger::LogDevice;TcRDoc::NormalClassLogDevice/previous_period_end-i.ri000064400000000416152376022770013247 0ustar00U:RDoc::AnyMethod[iI"previous_period_end:EFI"*Logger::LogDevice#previous_period_end;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I" (now);T@ FI"LogDevice;TcRDoc::NormalClass00LogDevice/eod-i.ri000064400000000354152376022770007753 0ustar00U:RDoc::AnyMethod[iI"eod:EFI"Logger::LogDevice#eod;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"(t);T@ FI"LogDevice;TcRDoc::NormalClass00Application/cdesc-Application.ri000064400000003122152376022770012676 0ustar00U:RDoc::NormalClass[iI"Application:ETI"Logger::Application;TI" Object;To:RDoc::Markup::Document: @parts[o;;[S:RDoc::Markup::Heading: leveli: textI"Description;To:RDoc::Markup::BlankLineo:RDoc::Markup::Paragraph;[I"ELogger::Application --- Add logging support to your application.;T@S; ; i; I" Usage;T@o:RDoc::Markup::List: @type: NUMBER: @items[o:RDoc::Markup::ListItem: @label0;[o; ;[I"@Define your application class as a sub-class of this class.;To;;0;[o; ;[I"?Override the +run+ method in your class to do many things.;To;;0;[o; ;[I"&Instantiate it and invoke #start.;T@S; ; i; I" Example;T@o:RDoc::Markup::Verbatim;[I"(class FooApp < Logger::Application ;TI"@ def initialize(foo_app, application_specific, arguments) ;TI"4 super('FooApp') # Name of the application. ;TI" end ;TI" ;TI" def run ;TI" ... ;TI", log(WARN, 'warning', 'my_method1') ;TI" ... ;TI"/ @log.error('my_method2') { 'Error!' } ;TI" ... ;TI" end ;TI" end ;TI" ;TI"$status = FooApp.new(....).start;T: @format0: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[[ I" appname;TI"R;T: publicFI"lib/logger.rb;T[[[I"Logger::Severity;To;;[;@:;0@?[[I" class;T[[;[[I"new;T@?[:protected[[: private[[I" instance;T[[;[ [I" level=;F@?[I"log;F@?[I" log=;F@?[I" logger;F@?[I" logger=;F@?[I" set_log;F@?[I" start;F@?[;[[;[[I"run;F@?[[U:RDoc::Context::Section[i0o;;[;0;0[@:I" Logger;TcRDoc::NormalClassApplication/new-c.ri000064400000001252152376022770010367 0ustar00U:RDoc::AnyMethod[iI"new:ETI"Logger::Application::new;TT: publico:RDoc::Markup::Document: @parts[ S:RDoc::Markup::Heading: leveli: textI" Args;To:RDoc::Markup::BlankLineo:RDoc::Markup::List: @type: NOTE: @items[o:RDoc::Markup::ListItem: @label[I"+appname+;T; [o:RDoc::Markup::Paragraph; [I"Name of the application.;T@ S; ; i; I"Description;T@ o;; [I"JCreate an instance. Log device is +STDERR+ by default. This can be ;TI"changed with #set_log.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0I"+Logger::Application.new(appname = '') ;T0[I"(appname = nil);T@FI"Application;TcRDoc::NormalClass00Application/logger-i.ri000064400000000540152376022770011062 0ustar00U:RDoc::AnyMethod[iI" logger:EFI"Logger::Application#logger;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"KLogger for this application. See the class Logger for an explanation.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"Application;TcRDoc::NormalClass00Application/logger%3d-i.ri000064400000000570152376022770011361 0ustar00U:RDoc::AnyMethod[iI" logger=:EFI" Logger::Application#logger=;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"HSets the logger for this application. See the class Logger for an ;TI"explanation.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I" (logger);T@FI"Application;TcRDoc::NormalClass00Application/run-i.ri000064400000000357152376022770010415 0ustar00U:RDoc::AnyMethod[iI"run:EFI"Logger::Application#run;TF: privateo:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@ FI"Application;TcRDoc::NormalClass00Application/log%3d-i.ri000064400000000366152376022770010666 0ustar00U:RDoc::AnyMethod[iI" log=:EFI"Logger::Application#log=;TF: publico:RDoc::Markup::Document: @parts[: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I" (logdev);T@ FI"Application;TcRDoc::NormalClass00Application/appname-i.ri000064400000000504152376022770011224 0ustar00U:RDoc::Attr[iI" appname:ETI" Logger::Application#appname;TI"R;T: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"1Name of the application given at initialize.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0F@I"Logger::Application;TcRDoc::NormalClass0Application/log-i.ri000064400000000551152376022770010366 0ustar00U:RDoc::AnyMethod[iI"log:EFI"Logger::Application#log;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I";See Logger#add. This application's +appname+ is used.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"&(severity, message = nil, &block);T@FI"Application;TcRDoc::NormalClass00Application/set_log-i.ri000064400000000665152376022770011247 0ustar00U:RDoc::AnyMethod[iI" set_log:EFI" Logger::Application#set_log;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"LSets the log device for this application. See Logger.new for ;TI"%an explanation of the arguments.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"2(logdev, shift_age = 0, shift_size = 1024000);T@FI"Application;TcRDoc::NormalClass00Application/start-i.ri000064400000000507152376022770010743 0ustar00U:RDoc::AnyMethod[iI" start:EFI"Logger::Application#start;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"4Start the application. Return the status code.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I"();T@FI"Application;TcRDoc::NormalClass00Application/level%3d-i.ri000064400000000533152376022770011210 0ustar00U:RDoc::AnyMethod[iI" level=:EFI"Logger::Application#level=;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"ASet the logging threshold, just like Logger#level=.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below000[I" (level);T@FI"Application;TcRDoc::NormalClass00