lib/lumberjack/logger.rb in lumberjack-1.2.4 vs lib/lumberjack/logger.rb in lumberjack-1.2.5
- old
+ new
@@ -235,48 +235,73 @@
# Return +true+ if +FATAL+ messages are being logged.
def fatal?
level <= FATAL
end
+
+ # Set the log level to fatal.
+ def fatal!
+ self.level = FATAL
+ end
# Log an +ERROR+ message. The message can be passed in either the +message+ argument or in a block.
def error(message_or_progname_or_tags = nil, progname_or_tags = nil, &block)
call_add_entry(ERROR, message_or_progname_or_tags, progname_or_tags, &block)
end
# Return +true+ if +ERROR+ messages are being logged.
def error?
level <= ERROR
end
+
+ # Set the log level to error.
+ def error!
+ self.level = ERROR
+ end
# Log a +WARN+ message. The message can be passed in either the +message+ argument or in a block.
def warn(message_or_progname_or_tags = nil, progname_or_tags = nil, &block)
call_add_entry(WARN, message_or_progname_or_tags, progname_or_tags, &block)
end
# Return +true+ if +WARN+ messages are being logged.
def warn?
level <= WARN
end
+
+ # Set the log level to warn.
+ def warn!
+ self.level = WARN
+ end
# Log an +INFO+ message. The message can be passed in either the +message+ argument or in a block.
def info(message_or_progname_or_tags = nil, progname_or_tags = nil, &block)
call_add_entry(INFO, message_or_progname_or_tags, progname_or_tags, &block)
end
# Return +true+ if +INFO+ messages are being logged.
def info?
level <= INFO
end
+
+ # Set the log level to info.
+ def info!
+ self.level = INFO
+ end
# Log a +DEBUG+ message. The message can be passed in either the +message+ argument or in a block.
def debug(message_or_progname_or_tags = nil, progname_or_tags = nil, &block)
call_add_entry(DEBUG, message_or_progname_or_tags, progname_or_tags, &block)
end
# Return +true+ if +DEBUG+ messages are being logged.
def debug?
level <= DEBUG
+ end
+
+ # Set the log level to debug.
+ def debug!
+ self.level = DEBUG
end
# Log a message when the severity is not known. Unknown messages will always appear in the log.
# The message can be passed in either the +message+ argument or in a block.
def unknown(message_or_progname_or_tags = nil, progname_or_tags = nil, &block)