logging 1.8.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -3
- data/History.txt +20 -0
- data/README.md +159 -0
- data/Rakefile +9 -5
- data/examples/appenders.rb +0 -4
- data/examples/layouts.rb +1 -8
- data/examples/names.rb +4 -4
- data/lib/logging.rb +24 -76
- data/lib/logging/appender.rb +71 -16
- data/lib/logging/appenders.rb +0 -2
- data/lib/logging/appenders/buffering.rb +32 -16
- data/lib/logging/appenders/file.rb +2 -2
- data/lib/logging/appenders/io.rb +1 -1
- data/lib/logging/appenders/rolling_file.rb +228 -165
- data/lib/logging/appenders/string_io.rb +1 -1
- data/lib/logging/appenders/syslog.rb +4 -4
- data/lib/logging/color_scheme.rb +20 -3
- data/lib/logging/diagnostic_context.rb +142 -17
- data/lib/logging/filter.rb +18 -0
- data/lib/logging/filters.rb +4 -0
- data/lib/logging/filters/level.rb +29 -0
- data/lib/logging/layout.rb +2 -2
- data/lib/logging/layouts/parseable.rb +5 -2
- data/lib/logging/layouts/pattern.rb +309 -168
- data/lib/logging/log_event.rb +5 -5
- data/lib/logging/logger.rb +55 -68
- data/lib/logging/repository.rb +24 -39
- data/lib/logging/root_logger.rb +1 -1
- data/lib/logging/utils.rb +4 -65
- data/lib/logging/version.rb +8 -0
- data/lib/rspec/logging_helper.rb +3 -3
- data/logging.gemspec +46 -0
- data/test/appenders/test_buffered_io.rb +29 -0
- data/test/appenders/test_file.rb +2 -2
- data/test/appenders/test_rolling_file.rb +62 -1
- data/test/layouts/test_color_pattern.rb +1 -1
- data/test/layouts/test_json.rb +3 -0
- data/test/layouts/test_pattern.rb +6 -2
- data/test/layouts/test_yaml.rb +4 -1
- data/test/test_appender.rb +56 -0
- data/test/test_filter.rb +33 -0
- data/test/test_layout.rb +4 -8
- data/test/test_log_event.rb +3 -3
- data/test/test_logger.rb +81 -57
- data/test/test_logging.rb +0 -59
- data/test/test_mapped_diagnostic_context.rb +49 -1
- data/test/test_nested_diagnostic_context.rb +16 -1
- data/test/test_repository.rb +24 -32
- data/test/test_utils.rb +14 -50
- metadata +35 -53
- data/README.rdoc +0 -143
- data/data/bad_logging_1.rb +0 -13
- data/data/bad_logging_2.rb +0 -21
- data/data/logging.rb +0 -42
- data/data/logging.yaml +0 -63
- data/data/simple_logging.rb +0 -13
- data/examples/consolidation.rb +0 -83
- data/lib/logging/appenders/email.rb +0 -178
- data/lib/logging/appenders/growl.rb +0 -200
- data/lib/logging/config/configurator.rb +0 -187
- data/lib/logging/config/yaml_configurator.rb +0 -190
- data/lib/logging/stats.rb +0 -277
- data/test/appenders/test_email.rb +0 -170
- data/test/appenders/test_growl.rb +0 -138
- data/test/config/test_configurator.rb +0 -69
- data/test/config/test_yaml_configurator.rb +0 -39
- data/test/test_consolidate.rb +0 -45
- data/test/test_stats.rb +0 -273
- data/version.txt +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d4abf77abb948de12d0e860a18be03b9b2314bd
|
4
|
+
data.tar.gz: f3bb7dc5daf79b192d56de6d2a96d217bebbe24b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31e6820636ea493830b4b880c112aa57a53fc4e283da0682b5dfbdb373d3040017889153e50f625525eb6e0e7e4d7e2752fd6fd60c8acbc909d249762b2fd879
|
7
|
+
data.tar.gz: c55a5532bcc8e6c8543f231484a11cb9f65a747afe231f58709fc13274962e6318a05a3e76d09b12c1793bc346cd87eca759e0eefa2185af1ea38d2caf554ab9
|
data/.travis.yml
CHANGED
data/History.txt
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
== 2.0.0 / 2015-03-28
|
2
|
+
|
3
|
+
Enhancements
|
4
|
+
- added event filtering via the Filter framework
|
5
|
+
- improvements to buffered logging
|
6
|
+
- code readability improvements around meta-programming
|
7
|
+
|
8
|
+
Bug Fixes
|
9
|
+
- fixed an `already initialized error`
|
10
|
+
- avoid unnecessary mutex-ing in logger lookup
|
11
|
+
|
12
|
+
Deprecations
|
13
|
+
- dropped Ruby 1.8 support
|
14
|
+
- removed logger consolidation
|
15
|
+
- removed YAML style configuration
|
16
|
+
- removed the Logging::Stats module
|
17
|
+
- removed the Hash#getopt method
|
18
|
+
- removed the Growl appender
|
19
|
+
- moved the Email appender to the logging-email plugin gem
|
20
|
+
|
1
21
|
== 1.8.2 / 2014-01-29
|
2
22
|
|
3
23
|
Bug Fixes
|
data/README.md
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
## Logging
|
2
|
+
by Tim Pease [](https://travis-ci.org/TwP/logging)
|
3
|
+
|
4
|
+
* [Homepage](http://rubygems.org/gems/logging)
|
5
|
+
* [Github Project](https://github.com/TwP/logging)
|
6
|
+
|
7
|
+
### Description
|
8
|
+
|
9
|
+
Logging is a flexible logging library for use in Ruby programs based on the
|
10
|
+
design of Java's log4j library. It features a hierarchical logging system,
|
11
|
+
custom level names, multiple output destinations per log event, custom
|
12
|
+
formatting, and more.
|
13
|
+
|
14
|
+
### Installation
|
15
|
+
|
16
|
+
```
|
17
|
+
gem install logging
|
18
|
+
```
|
19
|
+
|
20
|
+
### Examples
|
21
|
+
|
22
|
+
This example configures a logger to output messages in a format similar to the
|
23
|
+
core ruby Logger class. Only log messages that are warnings or higher will be
|
24
|
+
logged.
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
require 'logging'
|
28
|
+
|
29
|
+
logger = Logging.logger(STDOUT)
|
30
|
+
logger.level = :warn
|
31
|
+
|
32
|
+
logger.debug "this debug message will not be output by the logger"
|
33
|
+
logger.warn "this is your last warning"
|
34
|
+
```
|
35
|
+
|
36
|
+
In this example, a single logger is created that will append to STDOUT and to a
|
37
|
+
file. Only log messages that are informational or higher will be logged.
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
require 'logging'
|
41
|
+
|
42
|
+
logger = Logging.logger['example_logger']
|
43
|
+
logger.level = :info
|
44
|
+
|
45
|
+
logger.add_appenders \
|
46
|
+
Logging.appenders.stdout,
|
47
|
+
Logging.appenders.file('example.log')
|
48
|
+
|
49
|
+
logger.debug "this debug message will not be output by the logger"
|
50
|
+
logger.info "just some friendly advice"
|
51
|
+
```
|
52
|
+
|
53
|
+
The Logging library was created to allow each class in a program to have its
|
54
|
+
own configurable logger. The logging level for a particular class can be
|
55
|
+
changed independently of all other loggers in the system. This example shows
|
56
|
+
the recommended way of accomplishing this.
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
require 'logging'
|
60
|
+
|
61
|
+
Logging.logger['FirstClass'].level = :warn
|
62
|
+
Logging.logger['SecondClass'].level = :debug
|
63
|
+
|
64
|
+
class FirstClass
|
65
|
+
def initialize
|
66
|
+
@logger = Logging.logger[self]
|
67
|
+
end
|
68
|
+
|
69
|
+
def some_method
|
70
|
+
@logger.debug "some method was called on #{self.inspect}"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
class SecondClass
|
75
|
+
def initialize
|
76
|
+
@logger = Logging.logger[self]
|
77
|
+
end
|
78
|
+
|
79
|
+
def another_method
|
80
|
+
@logger.debug "another method was called on #{self.inspect}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
```
|
84
|
+
|
85
|
+
There are many more examples in the [examples folder](https://github.com/TwP/logging/tree/master/examples)
|
86
|
+
of the logging package. The recommended reading order is the following:
|
87
|
+
|
88
|
+
* [simple.rb](https://github.com/TwP/logging/blob/master/examples/simple.rb)
|
89
|
+
* [rspec_integration.rb](https://github.com/TwP/logging/blob/master/examples/rspec_integration.rb)
|
90
|
+
* [loggers.rb](https://github.com/TwP/logging/blob/master/examples/loggers.rb)
|
91
|
+
* [classes.rb](https://github.com/TwP/logging/blob/master/examples/classes.rb)
|
92
|
+
* [hierarchies.rb](https://github.com/TwP/logging/blob/master/examples/hierarchies.rb)
|
93
|
+
* [names.rb](https://github.com/TwP/logging/blob/master/examples/names.rb)
|
94
|
+
* [lazy.rb](https://github.com/TwP/logging/blob/master/examples/lazy.rb)
|
95
|
+
* [appenders.rb](https://github.com/TwP/logging/blob/master/examples/appenders.rb)
|
96
|
+
* [layouts.rb](https://github.com/TwP/logging/blob/master/examples/layouts.rb)
|
97
|
+
* [formatting.rb](https://github.com/TwP/logging/blob/master/examples/formatting.rb)
|
98
|
+
* [colorization.rb](https://github.com/TwP/logging/blob/master/examples/colorization.rb)
|
99
|
+
* [consolidation.rb](https://github.com/TwP/logging/blob/master/examples/consolidation.rb)
|
100
|
+
* [fork.rb](https://github.com/TwP/logging/blob/master/examples/fork.rb)
|
101
|
+
* [mdc.rb](https://github.com/TwP/logging/blob/master/examples/mdc.rb)
|
102
|
+
|
103
|
+
### Extending
|
104
|
+
|
105
|
+
The Logging framework is extensible via the [little-plugger](https://github.com/twp/little-plugger)
|
106
|
+
gem based plugin system. New appenders or formatters can be released as ruby
|
107
|
+
gems. When installed locally, the Logging framework will automatically detect
|
108
|
+
these gems as plugins and make them available for use.
|
109
|
+
|
110
|
+
The [logging-email](https://github.com/twp/logging-email) plugin is a good
|
111
|
+
example to follow. It includes a [`lib/logging/plugins/email.rb`](https://github.com/twp/logging-email/tree/master/lib/logging/plugins/email.rb)
|
112
|
+
file which is detected by the plugin framework. This file declares a
|
113
|
+
`Logging::Plugins::Email.initialize_email` method that is called when the plugin
|
114
|
+
is loaded.
|
115
|
+
|
116
|
+
The three steps for creating a plugin are:
|
117
|
+
|
118
|
+
* create a new Ruby gem: `logging-<name>`
|
119
|
+
* include a plugin file: `lib/logging/plugins/<name>.rb`
|
120
|
+
* definie a plugin initializer: `Logging::Plugins::<Name>.initialize_<name>`
|
121
|
+
|
122
|
+
### Development
|
123
|
+
|
124
|
+
The Logging source code relies on the Mr Bones project for default rake tasks.
|
125
|
+
You will need to install the Mr Bones gem if you want to build or test the
|
126
|
+
logging gem. Conveniently there is a bootstrap script that you can run to setup
|
127
|
+
your development environment.
|
128
|
+
|
129
|
+
```
|
130
|
+
script/bootstrap
|
131
|
+
```
|
132
|
+
|
133
|
+
This will install the Mr Bones gem and the required Ruby gems for development.
|
134
|
+
After this is done you can rake `rake -T` to see the available rake tasks.
|
135
|
+
|
136
|
+
### License
|
137
|
+
|
138
|
+
The MIT License
|
139
|
+
|
140
|
+
Copyright (c) 2015 Tim Pease
|
141
|
+
|
142
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
143
|
+
a copy of this software and associated documentation files (the
|
144
|
+
'Software'), to deal in the Software without restriction, including
|
145
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
146
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
147
|
+
permit persons to whom the Software is furnished to do so, subject to
|
148
|
+
the following conditions:
|
149
|
+
|
150
|
+
The above copyright notice and this permission notice shall be
|
151
|
+
included in all copies or substantial portions of the Software.
|
152
|
+
|
153
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
154
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
155
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
156
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
157
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
158
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
159
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,10 +1,13 @@
|
|
1
|
-
|
2
1
|
begin
|
3
2
|
require 'bones'
|
4
3
|
rescue LoadError
|
5
4
|
abort '### please install the "bones" gem ###'
|
6
5
|
end
|
7
6
|
|
7
|
+
lib = File.expand_path('../lib', __FILE__)
|
8
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
9
|
+
require 'logging/version'
|
10
|
+
|
8
11
|
task :default => 'test:run'
|
9
12
|
task 'gem:release' => 'test:run'
|
10
13
|
|
@@ -14,6 +17,7 @@ Bones {
|
|
14
17
|
authors 'Tim Pease'
|
15
18
|
email 'tim.pease@gmail.com'
|
16
19
|
url 'http://rubygems.org/gems/logging'
|
20
|
+
version Logging::VERSION
|
17
21
|
|
18
22
|
rdoc.exclude << '^data'
|
19
23
|
rdoc.include << '^examples/.*\.rb'
|
@@ -21,11 +25,11 @@ Bones {
|
|
21
25
|
|
22
26
|
use_gmail
|
23
27
|
|
24
|
-
depend_on 'little-plugger'
|
25
|
-
depend_on 'multi_json'
|
28
|
+
depend_on 'little-plugger', '~> 1.1'
|
29
|
+
depend_on 'multi_json', '~> 1.10'
|
26
30
|
|
27
|
-
depend_on 'flexmock',
|
28
|
-
depend_on 'bones-git',
|
31
|
+
depend_on 'flexmock', '~> 1.0', :development => true
|
32
|
+
depend_on 'bones-git', '~> 1.3', :development => true
|
29
33
|
#depend_on 'bones-rcov', :development => true
|
30
34
|
}
|
31
35
|
|
data/examples/appenders.rb
CHANGED
@@ -8,9 +8,7 @@
|
|
8
8
|
# description of each. Please refer to the documentation for specific
|
9
9
|
# configuration options available for each.
|
10
10
|
#
|
11
|
-
# Email generates e-mail messages
|
12
11
|
# File writes to a regular file
|
13
|
-
# Growl outputs growl notifications (Mac OS X only)
|
14
12
|
# IO generic IO appender
|
15
13
|
# RollingFile writes to a file and rolls based on size or age
|
16
14
|
# Stdout appends to STDOUT
|
@@ -20,9 +18,7 @@
|
|
20
18
|
#
|
21
19
|
# And you can access these appenders:
|
22
20
|
#
|
23
|
-
# Logging.appenders.email
|
24
21
|
# Logging.appenders.file
|
25
|
-
# Logging.appenders.growl
|
26
22
|
# Logging.appenders.io
|
27
23
|
# Logging.appenders.rolling_file
|
28
24
|
# Logging.appenders.stdout
|
data/examples/layouts.rb
CHANGED
@@ -28,15 +28,8 @@
|
|
28
28
|
:layout => Logging.layouts.json
|
29
29
|
)
|
30
30
|
|
31
|
-
# send growl notifications for errors and fatals using a nice pattern
|
32
|
-
Logging.appenders.growl(
|
33
|
-
'growl',
|
34
|
-
:level => :error,
|
35
|
-
:layout => Logging.layouts.pattern(:pattern => '[%d] %-5l: %m\n')
|
36
|
-
)
|
37
|
-
|
38
31
|
log = Logging.logger['Foo::Bar']
|
39
|
-
log.add_appenders 'stdout', 'development.log'
|
32
|
+
log.add_appenders 'stdout', 'development.log'
|
40
33
|
log.level = :debug
|
41
34
|
|
42
35
|
log.debug "a very nice little debug message"
|
data/examples/names.rb
CHANGED
@@ -22,15 +22,15 @@
|
|
22
22
|
require 'logging'
|
23
23
|
|
24
24
|
Logging.appenders.file('Debug File', :filename => 'debug.log')
|
25
|
-
Logging.appenders.
|
25
|
+
Logging.appenders.stderr('Standard Error', :level => :error)
|
26
26
|
|
27
27
|
# configure the root logger
|
28
28
|
Logging.logger.root.appenders = 'Debug File'
|
29
29
|
Logging.logger.root.level = :debug
|
30
30
|
|
31
|
-
# add the
|
32
|
-
# appender and the root logger's appender, too)
|
33
|
-
Logging.logger['Critical'].appenders = '
|
31
|
+
# add the Standard Error appender to the Critical logger (it will use it's
|
32
|
+
# own appender and the root logger's appender, too)
|
33
|
+
Logging.logger['Critical'].appenders = 'Standard Error'
|
34
34
|
|
35
35
|
# if you'll notice above, assigning appenders using just the name is valid
|
36
36
|
# the logger is smart enough to figure out it was given a string and then
|
data/lib/logging.rb
CHANGED
@@ -1,8 +1,3 @@
|
|
1
|
-
|
2
|
-
# Equivalent to a header guard in C/C++
|
3
|
-
# Used to prevent the class/module from being loaded more than once
|
4
|
-
unless defined? Logging
|
5
|
-
|
6
1
|
require File.expand_path('../logging/utils', __FILE__)
|
7
2
|
|
8
3
|
require 'yaml'
|
@@ -11,7 +6,12 @@ require 'fileutils'
|
|
11
6
|
require 'little-plugger'
|
12
7
|
require 'multi_json'
|
13
8
|
|
14
|
-
|
9
|
+
begin
|
10
|
+
require 'syslog'
|
11
|
+
HAVE_SYSLOG = true
|
12
|
+
rescue LoadError
|
13
|
+
HAVE_SYSLOG = false
|
14
|
+
end
|
15
15
|
|
16
16
|
#
|
17
17
|
#
|
@@ -28,28 +28,6 @@ module Logging
|
|
28
28
|
|
29
29
|
class << self
|
30
30
|
|
31
|
-
# call-seq:
|
32
|
-
# Logging.configure( filename )
|
33
|
-
# Logging.configure { block }
|
34
|
-
#
|
35
|
-
# Configures the Logging framework using the configuration information
|
36
|
-
# found in the given file. The file extension should be either '.yaml'
|
37
|
-
# or '.yml' (XML configuration is not yet supported).
|
38
|
-
#
|
39
|
-
def configure( *args, &block )
|
40
|
-
if block
|
41
|
-
return ::Logging::Config::Configurator.process(&block)
|
42
|
-
end
|
43
|
-
|
44
|
-
filename = args.shift
|
45
|
-
raise ArgumentError, 'a filename was not given' if filename.nil?
|
46
|
-
|
47
|
-
case File.extname(filename)
|
48
|
-
when '.yaml', '.yml'
|
49
|
-
::Logging::Config::YamlConfigurator.load(filename, *args)
|
50
|
-
else raise ArgumentError, 'unknown configuration file format' end
|
51
|
-
end
|
52
|
-
|
53
31
|
# call-seq:
|
54
32
|
# Logging.logger( device, age = 7, size = 1048576 )
|
55
33
|
# Logging.logger( device, age = 'weekly' )
|
@@ -185,34 +163,6 @@ module Logging
|
|
185
163
|
self
|
186
164
|
end
|
187
165
|
|
188
|
-
# call-seq:
|
189
|
-
# Logging.consolidate( 'First::Name', 'Second::Name', ... )
|
190
|
-
#
|
191
|
-
# Consolidate all loggers under the given namespace. All child loggers
|
192
|
-
# in the namespace will use the "consolidated" namespace logger instead
|
193
|
-
# of creating a new logger for each class or module.
|
194
|
-
#
|
195
|
-
# If the "root" logger name is passed to this method then all loggers
|
196
|
-
# will consolidate to the root logger. In other words, only the root
|
197
|
-
# logger will be created, and it will be used by all classes and modules
|
198
|
-
# in the application.
|
199
|
-
#
|
200
|
-
# ==== Example
|
201
|
-
#
|
202
|
-
# Logging.consolidate( 'Foo' )
|
203
|
-
#
|
204
|
-
# foo = Logging.logger['Foo']
|
205
|
-
# bar = Logging.logger['Foo::Bar']
|
206
|
-
# baz = Logging.logger['Baz']
|
207
|
-
#
|
208
|
-
# foo.object_id == bar.object_id #=> true
|
209
|
-
# foo.object_id == baz.object_id #=> false
|
210
|
-
#
|
211
|
-
def consolidate( *args )
|
212
|
-
::Logging::Repository.instance.add_master(*args)
|
213
|
-
self
|
214
|
-
end
|
215
|
-
|
216
166
|
# call-seq:
|
217
167
|
# include Logging.globally
|
218
168
|
# include Logging.globally( :logger )
|
@@ -361,12 +311,6 @@ module Logging
|
|
361
311
|
end
|
362
312
|
end
|
363
313
|
|
364
|
-
# Returns the version string for the library.
|
365
|
-
#
|
366
|
-
def version
|
367
|
-
@version ||= File.read(path('version.txt')).strip
|
368
|
-
end
|
369
|
-
|
370
314
|
# Returns the library path for the module. If any arguments are given,
|
371
315
|
# they will be joined to the end of the library path using
|
372
316
|
# <tt>File.join</tt>.
|
@@ -434,11 +378,11 @@ module Logging
|
|
434
378
|
# that the logger will *not* pass log events up to the
|
435
379
|
# parent logger
|
436
380
|
#
|
437
|
-
# 4)
|
438
|
-
# information in generated log events (this
|
439
|
-
# filename and line number of the log
|
440
|
-
# shows that the logger does not include
|
441
|
-
# information in the log events
|
381
|
+
# 4) tracing - a "+T" shows that the logger will include caller
|
382
|
+
# tracing information in generated log events (this
|
383
|
+
# includes filename and line number of the log
|
384
|
+
# message); "-T" shows that the logger does not include
|
385
|
+
# caller tracing information in the log events
|
442
386
|
#
|
443
387
|
# If a logger has appenders then they are listed, one per line,
|
444
388
|
# immediately below the logger. Appender lines are pre-pended with a
|
@@ -463,7 +407,7 @@ module Logging
|
|
463
407
|
def show_configuration( io = STDOUT, logger = 'root', indent = 0 )
|
464
408
|
logger = ::Logging::Logger[logger] unless ::Logging::Logger === logger
|
465
409
|
|
466
|
-
logger._dump_configuration(
|
410
|
+
io << logger._dump_configuration(indent)
|
467
411
|
|
468
412
|
indent += 2
|
469
413
|
children = ::Logging::Repository.instance.children(logger.name)
|
@@ -471,7 +415,7 @@ module Logging
|
|
471
415
|
::Logging.show_configuration(io, child, indent)
|
472
416
|
end
|
473
417
|
|
474
|
-
|
418
|
+
io
|
475
419
|
end
|
476
420
|
|
477
421
|
# :stopdoc:
|
@@ -497,6 +441,14 @@ module Logging
|
|
497
441
|
::Logging::Logger[::Logging].__send__(levelify(LNAMES[level]), &block)
|
498
442
|
end
|
499
443
|
|
444
|
+
# Internal logging method for handling exceptions. If the
|
445
|
+
# `Thread#abort_on_exception` flag is set then the
|
446
|
+
# exception will be raised again.
|
447
|
+
def log_internal_error( err )
|
448
|
+
log_internal(-2) { err }
|
449
|
+
raise err if Thread.abort_on_exception
|
450
|
+
end
|
451
|
+
|
500
452
|
# Close all appenders
|
501
453
|
def shutdown( *args )
|
502
454
|
return unless initialized?
|
@@ -526,22 +478,21 @@ module Logging
|
|
526
478
|
# :startdoc:
|
527
479
|
end
|
528
480
|
|
481
|
+
require libpath('logging/version')
|
529
482
|
require libpath('logging/appender')
|
530
483
|
require libpath('logging/layout')
|
484
|
+
require libpath('logging/filter')
|
531
485
|
require libpath('logging/log_event')
|
532
486
|
require libpath('logging/logger')
|
533
487
|
require libpath('logging/repository')
|
534
488
|
require libpath('logging/root_logger')
|
535
|
-
require libpath('logging/stats')
|
536
489
|
require libpath('logging/color_scheme')
|
537
490
|
require libpath('logging/appenders')
|
538
491
|
require libpath('logging/layouts')
|
492
|
+
require libpath('logging/filters')
|
539
493
|
require libpath('logging/proxy')
|
540
494
|
require libpath('logging/diagnostic_context')
|
541
495
|
|
542
|
-
require libpath('logging/config/configurator')
|
543
|
-
require libpath('logging/config/yaml_configurator')
|
544
|
-
|
545
496
|
require libpath('logging/rails_compat')
|
546
497
|
end # module Logging
|
547
498
|
|
@@ -554,6 +505,3 @@ end # module Logging
|
|
554
505
|
# application. This is required when daemonizing.
|
555
506
|
#
|
556
507
|
ObjectSpace.define_finalizer self, Logging.method(:shutdown)
|
557
|
-
|
558
|
-
end # unless defined?
|
559
|
-
|