loggability 0.8.0 → 0.8.1
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
- checksums.yaml.gz.sig +2 -2
- data.tar.gz.sig +0 -0
- data/ChangeLog +77 -1
- data/History.rdoc +5 -0
- data/lib/loggability.rb +2 -2
- data/lib/loggability/override.rb +27 -17
- data/spec/loggability/override_spec.rb +16 -0
- metadata +2 -2
- metadata.gz.sig +1 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cd32c093968b3ea5843c6697f92de513c0b0cf86
|
|
4
|
+
data.tar.gz: 77d614d2a678792322dc0662d49fb18d2a31f158
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d66083a3f8fa879ebfec74866d630706b47bf1a1db88a8bb073274c6d447350e85d45dfcf61ca229623dfeb89dab1a76fc2e7f0472b1d6f5e36b3829865e67bf
|
|
7
|
+
data.tar.gz: 774215025c07daf8c795908f9305f9f6ee4eb51bcb4c29ba117e50c22186f689e4a8a83f393715d8f1bd09df49132e5d9e6c9c55152835ff7769c7c1f0d711e7
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
b�I�D>� ���U�N.��է�\'t�&��m
|
|
2
|
+
�����F���n��$��[=�>]���cZ��`���y�e}�y�#k�~ (`]9sO�m9s-���O�S߿��Nݎ��I�����M��hƭ��/ß�t��ڕ~],��ݳ��;��m7�9+�?o3~���P��BԎ��.'oԺIX݈z������^�An�9W�օڋEAd�ĉ���h!�8隞�ã�����������xm��G�#ヺM,-�
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/ChangeLog
CHANGED
|
@@ -1,8 +1,84 @@
|
|
|
1
|
+
2013-10-07 Michael Granger <ged@FaerieMUD.org>
|
|
2
|
+
|
|
3
|
+
* .hgtags:
|
|
4
|
+
Added tag v0.8.0 for changeset 9e8338f511bf
|
|
5
|
+
[d9e93e136b47] [tip]
|
|
6
|
+
|
|
7
|
+
* .hgsigs:
|
|
8
|
+
Added signature for changeset a4c6b86b7cbc
|
|
9
|
+
[9e8338f511bf] [v0.8.0]
|
|
10
|
+
|
|
11
|
+
* History.rdoc, lib/loggability.rb:
|
|
12
|
+
Bump minor version, update history.
|
|
13
|
+
[a4c6b86b7cbc]
|
|
14
|
+
|
|
15
|
+
2013-10-06 Michael Granger <ged@FaerieMUD.org>
|
|
16
|
+
|
|
17
|
+
* .hgignore, Gemfile.lock:
|
|
18
|
+
Remove generated file.
|
|
19
|
+
[377006201c40] [github/master]
|
|
20
|
+
|
|
21
|
+
* loggability.gemspec:
|
|
22
|
+
Remove generated file.
|
|
23
|
+
[d18c5ee6d94a]
|
|
24
|
+
|
|
25
|
+
* Manifest.txt, lib/loggability.rb, lib/loggability/override.rb,
|
|
26
|
+
spec/loggability/override_spec.rb, spec/loggability_spec.rb:
|
|
27
|
+
Fix some bugs in aggregated overrides.
|
|
28
|
+
|
|
29
|
+
- Make cloning an override additive
|
|
30
|
+
- Add missing ::with_level and ::formatted_with module methods to
|
|
31
|
+
Loggability.
|
|
32
|
+
- Clear overridden settings in dups of Override objects.
|
|
33
|
+
- Update the manifest.
|
|
34
|
+
[44b025b728e6]
|
|
35
|
+
|
|
36
|
+
* README.rdoc, lib/loggability.rb, lib/loggability/logger.rb,
|
|
37
|
+
lib/loggability/override.rb, spec/loggability/logger_spec.rb,
|
|
38
|
+
spec/loggability/override_spec.rb, spec/loggability_spec.rb:
|
|
39
|
+
Add mechanism for temporary aggregated overrides
|
|
40
|
+
[a7d4b92e17f3]
|
|
41
|
+
|
|
42
|
+
2013-10-04 Michael Granger <ged@FaerieMUD.org>
|
|
43
|
+
|
|
44
|
+
* Gemfile, Gemfile.lock, Rakefile, lib/loggability.rb,
|
|
45
|
+
lib/loggability/logclient.rb, lib/loggability/loghost.rb,
|
|
46
|
+
loggability.gemspec, spec/helpers.rb, spec/lib/helpers.rb,
|
|
47
|
+
spec/loggability/formatter/color_spec.rb,
|
|
48
|
+
spec/loggability/formatter/html_spec.rb,
|
|
49
|
+
spec/loggability/formatter_spec.rb, spec/loggability/logger_spec.rb,
|
|
50
|
+
spec/loggability_spec.rb:
|
|
51
|
+
Update specs to use new RSpec syntax.
|
|
52
|
+
|
|
53
|
+
- Split out LogHost and LogClient mixins into their own files
|
|
54
|
+
- Added generated gemspec and Gemfile
|
|
55
|
+
- Dropped support for Ruby < 1.9.3.
|
|
56
|
+
[c67cab6ae3be]
|
|
57
|
+
|
|
58
|
+
2013-08-23 Michael Granger <ged@FaerieMUD.org>
|
|
59
|
+
|
|
60
|
+
* .hgtags:
|
|
61
|
+
Added tag v0.7.0 for changeset d0325195530a
|
|
62
|
+
[6237423fc190]
|
|
63
|
+
|
|
64
|
+
* .hgsigs:
|
|
65
|
+
Added signature for changeset 7e7b1c51eb3e
|
|
66
|
+
[d0325195530a] [v0.7.0]
|
|
67
|
+
|
|
68
|
+
* History.rdoc, lib/loggability.rb:
|
|
69
|
+
Bump minor version, update history.
|
|
70
|
+
[7e7b1c51eb3e]
|
|
71
|
+
|
|
72
|
+
* .rvm.gems, Rakefile, lib/loggability/logger.rb,
|
|
73
|
+
spec/loggability/logger_spec.rb:
|
|
74
|
+
Override Logger#<< to always append with formatting and level.
|
|
75
|
+
[5404625dc822]
|
|
76
|
+
|
|
1
77
|
2013-06-07 Mahlon E. Smith <mahlon@martini.nu>
|
|
2
78
|
|
|
3
79
|
* .hgtags:
|
|
4
80
|
Added tag v0.6.1 for changeset f61e00b53f9d
|
|
5
|
-
[26c3fbf32d31]
|
|
81
|
+
[26c3fbf32d31]
|
|
6
82
|
|
|
7
83
|
* .hgsigs:
|
|
8
84
|
Added signature for changeset 693e882b2e43
|
data/History.rdoc
CHANGED
data/lib/loggability.rb
CHANGED
|
@@ -9,10 +9,10 @@ require 'date'
|
|
|
9
9
|
module Loggability
|
|
10
10
|
|
|
11
11
|
# Package version constant
|
|
12
|
-
VERSION = '0.8.
|
|
12
|
+
VERSION = '0.8.1'
|
|
13
13
|
|
|
14
14
|
# VCS revision
|
|
15
|
-
REVISION = %q$Revision:
|
|
15
|
+
REVISION = %q$Revision: db603bf7b399 $
|
|
16
16
|
|
|
17
17
|
# The key for the global logger (Loggability's own logger)
|
|
18
18
|
GLOBAL_KEY = :__global__
|
data/lib/loggability/override.rb
CHANGED
|
@@ -19,21 +19,27 @@ class Loggability::Override
|
|
|
19
19
|
include MonitorMixin
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
###
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
### Set up an Override with its logging level set to +newlevel+. If called with
|
|
23
|
+
### a block, call #call immediately on the Override with the block and return
|
|
24
|
+
### the result of that instead.
|
|
25
|
+
def self::with_level( new_level, &block )
|
|
26
|
+
return self.new( level: new_level, &block )
|
|
25
27
|
end
|
|
26
28
|
|
|
27
29
|
|
|
28
|
-
###
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
### Set up an Override with its logging output set to +new_destination+. If called with
|
|
31
|
+
### a block, call #call immediately on the Override with the block and return
|
|
32
|
+
### the result of that instead.
|
|
33
|
+
def self::outputting_to( new_destination, &block )
|
|
34
|
+
return self.new( logdev: new_destination, &block )
|
|
31
35
|
end
|
|
32
36
|
|
|
33
37
|
|
|
34
|
-
###
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
### Set up an Override with its logging formatter set to +formatter+. If called with
|
|
39
|
+
### a block, call #call immediately on the Override with the block and return
|
|
40
|
+
### the result of that instead.
|
|
41
|
+
def self::formatted_with( new_formatter, &block )
|
|
42
|
+
return self.new( formatter: new_formatter, &block )
|
|
37
43
|
end
|
|
38
44
|
|
|
39
45
|
|
|
@@ -93,22 +99,22 @@ class Loggability::Override
|
|
|
93
99
|
|
|
94
100
|
### Return a clone of the receiving Override with its logging level
|
|
95
101
|
### set to +newlevel+.
|
|
96
|
-
def with_level( new_level )
|
|
97
|
-
return self.clone_with( level: new_level )
|
|
102
|
+
def with_level( new_level, &block )
|
|
103
|
+
return self.clone_with( level: new_level, &block )
|
|
98
104
|
end
|
|
99
105
|
|
|
100
106
|
|
|
101
107
|
### Return a clone of the receiving Override with its logging output
|
|
102
108
|
### set to +new_destination+.
|
|
103
|
-
def outputting_to( new_destination )
|
|
104
|
-
return self.clone_with( logdev: new_destination )
|
|
109
|
+
def outputting_to( new_destination, &block )
|
|
110
|
+
return self.clone_with( logdev: new_destination, &block )
|
|
105
111
|
end
|
|
106
112
|
|
|
107
113
|
|
|
108
114
|
### Return a clone of the receiving Override with its logging formatter
|
|
109
115
|
### set to +formatter+.
|
|
110
|
-
def formatted_with( new_formatter )
|
|
111
|
-
return self.clone_with( formatter: new_formatter )
|
|
116
|
+
def formatted_with( new_formatter, &block )
|
|
117
|
+
return self.clone_with( formatter: new_formatter, &block )
|
|
112
118
|
end
|
|
113
119
|
|
|
114
120
|
|
|
@@ -129,11 +135,15 @@ class Loggability::Override
|
|
|
129
135
|
#########
|
|
130
136
|
|
|
131
137
|
### Return a clone that has been modified with the specified +new_settings+.
|
|
132
|
-
def clone_with( new_settings )
|
|
138
|
+
def clone_with( new_settings, &block )
|
|
133
139
|
newobj = self.dup
|
|
134
140
|
newobj.settings.merge!( new_settings )
|
|
135
141
|
|
|
136
|
-
|
|
142
|
+
if block
|
|
143
|
+
return newobj.call( &block )
|
|
144
|
+
else
|
|
145
|
+
return newobj
|
|
146
|
+
end
|
|
137
147
|
end
|
|
138
148
|
|
|
139
149
|
|
|
@@ -130,5 +130,21 @@ describe Loggability::Override do
|
|
|
130
130
|
expect( override.settings[:level] ).to be( :debug )
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
+
it "executes a block passed to a mutator with the mutated override" do
|
|
134
|
+
Loggability.level = :info
|
|
135
|
+
Loggability.format_with( :default )
|
|
136
|
+
|
|
137
|
+
log = []
|
|
138
|
+
result = override.formatted_with( :html ).with_level( :debug ).outputting_to( log ) do
|
|
139
|
+
Loggability[ loghost ].debug "Doing it!"
|
|
140
|
+
:did_it
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
expect( result ).to eq( :did_it )
|
|
145
|
+
expect( log ).to have( 1 ).entry
|
|
146
|
+
expect( log.first ).to match( /Doing it!/ )
|
|
147
|
+
end
|
|
148
|
+
|
|
133
149
|
end
|
|
134
150
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: loggability
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Granger
|
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
|
30
30
|
6mKCwjpegytE0oifXfF8k75A9105cBnNiMZOe1tXiqYc/exCgWvbggurzDOcRkZu
|
|
31
31
|
/YSusaiDXHKU2O3Akc3htA==
|
|
32
32
|
-----END CERTIFICATE-----
|
|
33
|
-
date: 2013-10-
|
|
33
|
+
date: 2013-10-09 00:00:00.000000000 Z
|
|
34
34
|
dependencies:
|
|
35
35
|
- !ruby/object:Gem::Dependency
|
|
36
36
|
name: hoe-mercurial
|
metadata.gz.sig
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Z/�ڋ���c:�Ӄ/�x�u����hLe����ؔ��v��8#�=�q�x"E�b<���A"��`�M'9L�kz��Qc��e�I�)�$f+GOSz"H����PS
|
|
1
|
+
<�R��[�K�m��.zI�1Ie&/_k���Lc��s�q��I,�O�L*^#��&s�0F���Xt��!TQ����f�ɧw���m݅
|