D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Logger
/
Filename :
new-c.ri
back
Copy
U:RDoc::AnyMethod[iI"new:ETI"Logger::new;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"(With the single argument +logdev+, ;TI"3returns a new logger with all default options:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I";Logger.new('t.log') # => #<Logger:0x000001e685dc6ac8> ;T:@format0o; ; [I"&Argument +logdev+ must be one of:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"2A string filepath: entries are to be written ;TI"@to the file at that path; if the file at that path exists, ;TI"new entries are appended.;To;;0; [o; ; [I"EAn IO stream (typically +$stdout+, +$stderr+. or an open file): ;TI"3entries are to be written to the given stream.;To;;0; [o; ; [I"9+nil+ or +File::NULL+: no entries are to be written.;T@o; ; [I"Examples:;T@o;; [I"Logger.new('t.log') ;TI"Logger.new($stdout) ;T; 0o; ; [I"The keyword options are:;T@o;;;;[o;;0; [o; ; [I"B+level+: sets the log level; default value is Logger::DEBUG. ;TI"0See {Log Level}[rdoc-ref:Logger@Log+Level]:;T@o;; [I"/Logger.new('t.log', level: Logger::ERROR) ;T; 0o;;0; [o; ; [I"B+progname+: sets the default program name; default is +nil+. ;TI"6See {Program Name}[rdoc-ref:Logger@Program+Name]:;T@o;; [I"+Logger.new('t.log', progname: 'mung') ;T; 0o;;0; [o; ; [I">+formatter+: sets the entry formatter; default is +nil+. ;TI"9See {formatter=}[Logger.html#attribute-i-formatter].;To;;0; [o; ; [I"=+datetime_format+: sets the format for entry timestamp; ;TI"default is +nil+. ;TI"See #datetime_format=.;To;;0; [o; ; [I"?+binmode+: sets whether the logger writes in binary mode; ;TI"default is +false+.;To;;0; [o; ; [I"D+shift_period_suffix+: sets the format for the filename suffix ;TI"Cfor periodic log file rotation; default is <tt>'%Y%m%d'</tt>. ;TI"@See {Periodic Rotation}[rdoc-ref:Logger@Periodic+Rotation].;To;;0; [o; ; [I"G+reraise_write_errors+: An array of exception classes, which will ;TI"Fbe reraised if there is an error when writing to the log device. ;TI"5The default is to swallow all exceptions raised.;T: @fileI"lib/logger.rb;T:0@omit_headings_from_table_of_contents_below0I"HLogger.new(logdev, shift_age = 0, shift_size = 1048576, **options) ;T0[ I"�(logdev, shift_age = 0, shift_size = 1048576, level: DEBUG, progname: nil, formatter: nil, datetime_format: nil, binmode: false, shift_period_suffix: '%Y%m%d', reraise_write_errors: []);T@iFI"Logger;TcRDoc::NormalClass00