See log4r/formatter/patternformatter.rb
Arguments to sprintf keyed to directive letters
%c - event short
name
%C - event fullname
%d - date
%g - Global Diagnostic
Context (GDC)
%t - trace
%m - message
%h
- thread name
%p - process ID aka PID
%M - formatted message
%l
- Level in string form
%x - Nested Diagnostic Context (NDC)
%X - Mapped Diagnostic Context (MDC), syntax is “%X{key}”
%% - Insert a
%
Matches the first directive encountered and the stuff around it.
$1 is the stuff before directive or “” if not applicable
$2 is the directive group or nil if there’s none
$3 is the %#.# match within directive group
$4 is the .# match which we don’t use (it’s there to match properly)
$5 is the directive letter
$6 is the stuff after the directive or “” if not applicable
$7 is the remainder
default date format
Accepts the following hash arguments (either a string or a symbol):
A pattern format string.
A Time#strftime format string. See the Ruby Time class for details.
As an option to date_pattern, specify which Time.now method to call. For example, usec or to_s. Specify it as a String or Symbol.
The default date format is ISO8601, which looks like this:
yyyy-mm-dd hh:mm:ss => 2001-01-12 13:15:50
# File lib/log4r/formatter/patternformatter.rb, line 79 79: def initialize(hash={}) 80: super(hash) 81: @pattern = (hash['pattern'] or hash[:pattern] or nil) 82: @date_pattern = (hash['date_pattern'] or hash[:date_pattern] or nil) 83: @date_method = (hash['date_method'] or hash[:date_method] or nil) 84: @date_pattern = ISO8601 if @date_pattern.nil? and @date_method.nil? 85: PatternFormatter.create_format_methods(self) 86: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.