spawning-logger 0.0.3 → 0.0.4
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/README.md +3 -2
- data/lib/spawning_logger.rb +3 -2
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b43d8042f3f6287e186a6068262749730b9db77
|
4
|
+
data.tar.gz: 822810f26636907c0d3cc4b4f31675d681d5ce08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 690d2f53f5065d9beed5097bb71d1b7ae4f989e032994fcefd3473c7cf5acb4cfa3d3c5416bc1bf1982570ec0de64cbc359943f54919e33a3e80136e122afd74
|
7
|
+
data.tar.gz: cb0d451b54f76d706660ac4771f17202bb849c008e239a12a35c1fe2a110b72af405570a3c8399221bf32f8755cdf47cc2b8b5ec8fe201bc599c18662ec19acf
|
data/README.md
CHANGED
@@ -10,7 +10,8 @@ This logger can spawn sub-loggers with different files, each of those file's nam
|
|
10
10
|
|
11
11
|
Also supports a preset logfile subdirectory in case you create many subloggers (for example you might be interested in splitting development, production, test logs into subdirectories).
|
12
12
|
|
13
|
-
Only the constructor is modified and the spawning factory method added, everything else is delegated to the ruby stdlib ::Logger class.
|
13
|
+
Only the constructor is modified and the spawning factory method added, everything else is delegated to the ruby stdlib ::Logger class.
|
14
|
+
|
14
15
|
## Examples:
|
15
16
|
|
16
17
|
### quick-n-dirty:
|
@@ -75,7 +76,7 @@ child_logger = logger.spawn('1')
|
|
75
76
|
|
76
77
|
```ruby
|
77
78
|
logger = SpawningLogger.new('log/server.log')
|
78
|
-
logger.send_self_and_spawn(:error,
|
79
|
+
logger.send_self_and_spawn('worker_1', :error, 'server shutdown')
|
79
80
|
|
80
81
|
# => "server shutdown" will show up in server.log and in server_worker_1.log
|
81
82
|
```
|
data/lib/spawning_logger.rb
CHANGED
@@ -59,7 +59,7 @@
|
|
59
59
|
#
|
60
60
|
# ```ruby
|
61
61
|
# logger = SpawningLogger.new('log/server.log')
|
62
|
-
# logger.send_self_and_spawn(:error,
|
62
|
+
# logger.send_self_and_spawn('worker_1', :error, 'server shutdown')
|
63
63
|
#
|
64
64
|
# # => "server shutdown" will show up in server.log and in server_worker_1.log
|
65
65
|
# ```
|
@@ -125,7 +125,8 @@ class SpawningLogger < ::Logger
|
|
125
125
|
end
|
126
126
|
|
127
127
|
# logs into the main logfile and also logs into a spawned logfile.
|
128
|
-
# @param
|
128
|
+
# @param child_name the child to spawn and log into
|
129
|
+
# @param method the method name to call, like :error, :info, :debug, ...
|
129
130
|
# @param message the message to send to both loggers
|
130
131
|
def send_self_and_spawn(child_name, method, message)
|
131
132
|
self.send(method, message)
|
data/lib/version.rb
CHANGED