Skip to content

Commit

Permalink
fixing up some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TwP committed May 5, 2009
1 parent 23dab50 commit 74469cf
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/appenders.rb
@@ -1,3 +1,4 @@
# :stopdoc:
#
# Appenders are used to output log events to some logging destination. The
# same log event can be sent to multiple desitnations by associating
Expand Down Expand Up @@ -42,3 +43,5 @@
# These messages will be logged to both the log file and to STDOUT
log.debug "a very nice little debug message"
log.warn "this is your last warning"

# :startdoc:
2 changes: 2 additions & 0 deletions examples/classes.rb
@@ -1,3 +1,4 @@
# :stopdoc:
#
# The Logging framework is very good about figuring out predictable names
# for loggers regardless of what object is used to create them. The name is
Expand Down Expand Up @@ -37,3 +38,4 @@ def initialize() @log = Logging.logger[self]; end
foo.info 'this message came from Foo'
bar.warn 'this is a warning from Foo::Bar'

# :startdoc:
2 changes: 2 additions & 0 deletions examples/consolidation.rb
@@ -1,3 +1,4 @@
# :stopdoc:
#
# Logging support can be included globally giving all objects in the Ruby
# space access to a logger instance. This "logger" method invokes
Expand Down Expand Up @@ -79,3 +80,4 @@ module FooBar
end
end

# :startdoc:
2 changes: 2 additions & 0 deletions examples/formatting.rb
@@ -1,3 +1,4 @@
# :stopdoc:
#
# Any Ruby object can be passed to the log methods of a logger. How these
# objects are formatted by the Logging framework is controlled by a global
Expand Down Expand Up @@ -47,3 +48,4 @@
log.error err
end

# :startdoc:
2 changes: 2 additions & 0 deletions examples/hierarchies.rb
@@ -1,3 +1,4 @@
# :stopdoc:
#
# Loggers exist in a hierarchical relationship defined by their names. Each
# logger has a parent (except for the root logger). A logger can zero or
Expand Down Expand Up @@ -69,3 +70,4 @@
puts '='*76
Logging.show_configuration

# :startdoc:
3 changes: 3 additions & 0 deletions examples/layouts.rb
@@ -1,3 +1,4 @@
# :stopdoc:
#
# The formatting of log messages is controlled by the layout given to the
# appender. By default all appenders use the Basic layout. It's pretty
Expand Down Expand Up @@ -43,3 +44,5 @@
log.warn "this is your last warning"
log.error StandardError.new("something went horribly wrong")
log.fatal "I Die!"

# :startdoc:
3 changes: 3 additions & 0 deletions examples/loggers.rb
@@ -1,3 +1,4 @@
# :stopdoc:
#
# Multiple loggers can be created and each can be configured with it's own
# log level and appenders. So one logger can be configured to output debug
Expand All @@ -24,3 +25,5 @@
log1.info "this message will not get logged"
log2.info "nor will this message"
log3.info "but this message will get logged"

# :startdoc:
3 changes: 3 additions & 0 deletions examples/names.rb
@@ -1,3 +1,4 @@
# :stopdoc:
#
# Loggers and appenders can be looked up by name. The bracket notation is
# used to find these objects:
Expand Down Expand Up @@ -38,3 +39,5 @@
# and now log some messages
Logging.logger['Critical'].info 'just keeping you informed'
Logging.logger['Critical'].fatal 'WTF!!'

# :startdoc:
3 changes: 3 additions & 0 deletions examples/simple.rb
@@ -1,3 +1,4 @@
# :stopdoc:
#
# Logging provides a simple, default logger configured in the same manner as
# the default Ruby Logger class -- i.e. the output of the two will be the
Expand All @@ -12,3 +13,5 @@

log.debug "this debug message will not be output by the logger"
log.warn "this is your last warning"

# :startdoc:

0 comments on commit 74469cf

Please sign in to comment.