Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.216.37
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby19 /
share /
ri /
1.9.1 /
system /
Logger /
Delete
Unzip
Name
Size
Permission
Date
Action
Application
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Formatter
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
LogDevice
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
Severity
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
%3c%3c-i.ri
283
B
-rw-r--r--
2023-07-26 17:26
add-i.ri
2.03
KB
-rw-r--r--
2023-07-26 17:26
cdesc-Logger.ri
7.66
KB
-rw-r--r--
2023-07-26 17:26
close-i.ri
205
B
-rw-r--r--
2023-07-26 17:26
datetime_format%3d-i.ri
431
B
-rw-r--r--
2023-07-26 17:26
datetime_format-i.ri
258
B
-rw-r--r--
2023-07-26 17:26
debug%3f-i.ri
278
B
-rw-r--r--
2023-07-26 17:26
debug-i.ri
297
B
-rw-r--r--
2023-07-26 17:26
error%3f-i.ri
278
B
-rw-r--r--
2023-07-26 17:26
error-i.ri
298
B
-rw-r--r--
2023-07-26 17:26
fatal%3f-i.ri
278
B
-rw-r--r--
2023-07-26 17:26
fatal-i.ri
297
B
-rw-r--r--
2023-07-26 17:26
format_message-i.ri
194
B
-rw-r--r--
2023-07-26 17:26
format_severity-i.ri
171
B
-rw-r--r--
2023-07-26 17:26
formatter-i.ri
954
B
-rw-r--r--
2023-07-26 17:26
info%3f-i.ri
275
B
-rw-r--r--
2023-07-26 17:26
info-i.ri
1.38
KB
-rw-r--r--
2023-07-26 17:26
level-i.ri
227
B
-rw-r--r--
2023-07-26 17:26
log-i.ri
185
B
-rw-r--r--
2023-07-26 17:26
new-c.ri
989
B
-rw-r--r--
2023-07-26 17:26
progname-i.ri
217
B
-rw-r--r--
2023-07-26 17:26
sev_threshold%3d-i.ri
245
B
-rw-r--r--
2023-07-26 17:26
sev_threshold-i.ri
243
B
-rw-r--r--
2023-07-26 17:26
unknown-i.ri
367
B
-rw-r--r--
2023-07-26 17:26
warn%3f-i.ri
275
B
-rw-r--r--
2023-07-26 17:26
warn-i.ri
294
B
-rw-r--r--
2023-07-26 17:26
Save
Rename
U:RDoc::NormalClass[iI"Logger:EF@I"Object;Fo:RDoc::Markup::Document:@parts[o;;[IS:RDoc::Markup::Heading: leveli: textI"Description;To:RDoc::Markup::BlankLine o:RDoc::Markup::Paragraph;[I"NThe Logger class provides a simple but sophisticated logging utility that;TI"$you can use to output messages.;T@o; ;[I"QThe messages have associated levels, such as +INFO+ or +ERROR+ that indicate;TI"Otheir importance. You can then give the Logger a level, and only messages;TI"-at that level of higher will be printed.;T@o; ;[I"The levels are:;T@o:RDoc::Markup::List: @type: NOTE:@items[ o:RDoc::Markup::ListItem:@labelI"+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"8generic (useful) information about system operation;To;;I"+DEBUG+;T;[o; ;[I")low-level information for developers;T@o; ;[ I"JFor 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"Qwant to know about the program's internal state, and would set the Logger to;TI" +DEBUG+.;T@o; ;[I"J*Note*: Logger does not escape or sanitize any messages passed to it.;TI"ODevelopers 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}") ;FI"+logger.info("User-input: %p" % input) ;Fo; ;[I"3You can use #formatter= for escaping all data.;T@o;;[ I"0original_formatter = Logger::Formatter.new ;FI"Clogger.formatter = proc { |severity, datetime, progname, msg| ;FI"G original_formatter.call(severity, datetime, progname, msg.dump) ;FI"} ;FI"logger.info(input) ;FS; ; i;I"Example;T@o; ;[I"PThis creates a logger to the standard output stream, with a level of +WARN+;T@o;;[I"log = Logger.new(STDOUT) ;FI"log.level = Logger::WARN ;FI" ;FI"!log.debug("Created logger") ;FI"!log.info("Program started") ;FI" log.warn("Nothing to do!") ;FI" ;FI"begin ;FI"& File.each_line(path) do |line| ;FI") unless line =~ /^(\w+) = (.*)$/ ;FI"6 log.error("Line in wrong format: #{line}") ;FI" end ;FI" end ;FI"rescue => err ;FI". log.fatal("Caught exception; exiting") ;FI" log.fatal(err) ;FI" end ;Fo; ;[I"NBecause the Logger's level is set to +WARN+, only the warning, error, and;TI"Kfatal messages are recorded. The debug and info messages are silently;TI"discarded.;T@S; ; i;I" Features;T@o; ;[ I"FThere are several interesting features that Logger provides, like;TI"Gauto-rolling of log files, setting the format of log messages, and;TI"Qspecifying 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"KThe 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) ;FI"!logger = Logger.new(STDOUT) ;Fo;;0;[o; ;[I"?Create a logger for the file which has the specified name.;T@o;;[I"(logger = Logger.new('logfile.log') ;Fo;;0;[o; ;[I",Create a logger for the specified file.;T@o;;[ I">file = File.open('foo.log', File::WRONLY | File::APPEND) ;FI"H# To create new (and to remove old) logfile, add File::CREAT like; ;FI"K# file = open('foo.log', File::WRONLY | File::APPEND | File::CREAT) ;FI"logger = Logger.new(file) ;Fo;;0;[o; ;[I"NCreate a logger which ages logfile once it reaches a certain size. Leave;TI"?10 "old log files" and each file is about 1,024,000 bytes.;T@o;;[I"1logger = Logger.new('foo.log', 10, 1024000) ;Fo;;0;[o; ;[I"=Create a logger which ages logfile daily/weekly/monthly.;T@o;;[I"-logger = Logger.new('foo.log', 'daily') ;FI".logger = Logger.new('foo.log', 'weekly') ;FI"/logger = Logger.new('foo.log', 'monthly') ;FS; ; i;I"How to log a message;T@o; ;[ I"NNotice the different methods (+fatal+, +error+, +info+) being used to log;TI"Mmessages of various levels? Other methods in this family are +warn+ and;TI"L+debug+. +add+ is used below to log a message of an arbitrary (perhaps;TI"dynamic) level.;T@o;;;;[ o;;0;[o; ;[I"Message in block.;T@o;;[I"2logger.fatal { "Argument 'foo' not given." } ;Fo;;0;[o; ;[I"Message as a string.;T@o;;[I"1logger.error "Argument #{ @foo } mismatch." ;Fo;;0;[o; ;[I"With progname.;T@o;;[I"5logger.info('initialize') { "Initializing..." } ;Fo;;0;[o; ;[I"With severity.;T@o;;[I"2logger.add(Logger::FATAL) { 'Fatal error!' } ;Fo; ;[I"JThe block form allows you to create potentially complex log messages,;TI"Bbut 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" } ;Fo; ;[I"QIf 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") ;Fo; ;[I"GHere, 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 ;FS; ; i;I"Setting severity threshold;T@o;;;;[o;;0;[o; ;[I"Original interface.;T@o;;[I")logger.sev_threshold = Logger::WARN ;Fo;;0;[o; ;[I"+Log4r (somewhat) compatible interface.;T@o;;[I"!logger.level = Logger::INFO ;FI" ;FI"3DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN ;FS; ; i;I"Format;T@o; ;[I"JLog 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"JSeverityID, [Date Time mSec #pid] SeverityLabel -- ProgName: message ;Fo; ;[I"Log sample:;To;;[I"JI, [Wed Mar 03 02:34:24 JST 1999 895701 #19074] INFO -- Main: info. ;Fo; ;[I"BYou may change the date and time format via #datetime_format=;T@o;;[I"2logger.datetime_format = "%Y-%m-%d %H:%M:%S" ;FI"( # e.g. "2004-01-03 00:54:26" ;Fo; ;[I"COr, you may change the overall format with #formatter= method.;T@o;;[ I"Dlogger.formatter = proc do |severity, datetime, progname, msg| ;FI" "#{datetime}: #{msg}\n" ;FI" end ;FI"<# e.g. "Thu Sep 22 08:51:08 GMT+9:00 2005: hello world";F: @fileI"lib/logger.rb;T;0[ [ I"formatter;FI"RW;F:publicF@)[ I" level;FI"RW;F;F@)[ I" progname;FI"RW;F;F@)[ I"sev_threshold;FI"RW;F;F@)[ I"sev_threshold=;FI"RW;F;F@)[[I"VERSION;Fo;;[ ;0@)[I" ProgName;Fo;;[ ;0@)[I"SEV_LABEL;Fo;;[o; ;[I"-Severity label for logging. (max 5 char);T;0@)[[I" Severity;Fo;;[ ;0@)[[I" class;F[[;[[I"new;F@)[:protected[ [:private[ [I" instance;F[[;[[I"<<;F@)[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@)