• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/ruby-106/ruby/lib/

Lines Matching +defs:log +defs:debug

63 #   logger.debug("Created logger")
81 # fatal messages are recorded. The debug and info messages are silently
87 # auto-rolling of log files, setting the format of log messages, and
106 # logger = Logger.new('logfile.log')
110 # file = File.open('foo.log', File::WRONLY | File::APPEND)
112 # # file = File.open('foo.log', File::WRONLY | File::APPEND | File::CREAT)
116 # Leave 10 "old" log files where each file is about 1,024,000 bytes.
118 # logger = Logger.new('foo.log', 10, 1024000)
122 # logger = Logger.new('foo.log', 'daily')
123 # logger = Logger.new('foo.log', 'weekly')
124 # logger = Logger.new('foo.log', 'monthly')
126 # === How to log a message
128 # Notice the different methods (+fatal+, +error+, +info+) being used to log
130 # +debug+. +add+ is used below to log a message of an arbitrary (perhaps
149 # The block form allows you to create potentially complex log messages,
153 # logger.debug { "This is a " + potentially + " expensive operation" }
155 # If the logger's level is +INFO+ or higher, no debug messages will be logged,
158 # logger.debug("This is a " + potentially + " expensive operation")
160 # Here, the string concatenation is done every time, even if the log
161 # level is not set to show the debug message.
239 # Program name to include in log messages.
257 # +severity+:: The Severity of the log message.
260 # +msg+:: The _Object_ the user passed to the log message; not necessarily a
273 def debug?; @level <= DEBUG; end
299 # The log device. This is a filename (String) or IO object (typically
302 # Number of old log files to keep, *or* frequency of rotation (+daily+,
333 # The log message. A String or Exception.
345 # log no message, and return +true+.
350 # logging method. Users will be more inclined to use #debug, #info, #warn,
354 # converted to a String in order to log it. Generally, +inspect+ is used
384 alias log add
387 # Dump given message to the log device without any formatting. If no log
401 def debug(progname = nil, &block)
412 # +message+:: The message to log; does not need to be a String.
414 # log message. The default can be set with #progname=.
415 # +block+:: Evaluates to the message to log. This is not evaluated unless
416 # the logger's level is sufficient to log the message. This
497 # Default formatter for log messages.
545 def initialize(log = nil, opt = {})
548 if log.respond_to?(:write) and log.respond_to?(:close)
549 @dev = log
551 @dev = open_logfile(log)
553 @filename = log
566 warn("log shifting failed. #{$!}")
572 warn("log writing failed. #{$!}")
576 warn("log writing failed. #{ignored}")
700 # log(WARN, 'warning', 'my_method1')
702 # @log.error('my_method2') { 'Error!' }
730 @log = Logger.new(STDERR)
731 @log.progname = @appname
732 @level = @log.level
741 log(INFO, "Start of #{ @appname }.")
744 log(FATAL, "Detected an exception. Stopping ... #{$!} (#{$!.class})\n" << $@.join("\n"))
746 log(INFO, "End of #{ @appname }. (status: #{ status.to_s })")
753 @log
761 @log = logger
762 @log.progname = @appname
763 @log.level = @level
767 # Sets the log device for this application. See <tt>Logger.new</tt> for
771 @log = Logger.new(logdev, shift_age, shift_size)
772 @log.progname = @appname
773 @log.level = @level
776 def log=(logdev)
785 @log.level = @level
791 def log(severity, message = nil, &block)
792 @log.add(severity, message, @appname, &block) if @log