loggability 0.2.3 → 0.3.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.
data/ChangeLog CHANGED
@@ -1,10 +1,84 @@
1
+ 2012-05-22 Michael Granger <ged@FaerieMUD.org>
2
+
3
+ * lib/loggability/formatter.rb, spec/loggability/formatter_spec.rb,
4
+ spec/loggability/logger_spec.rb:
5
+ Downcase the severity before outputting.
6
+ [040bb1a5dc84] [tip]
7
+
8
+ 2012-05-18 Michael Granger <ged@FaerieMUD.org>
9
+
10
+ * .hgtags:
11
+ Added tag v0.2.3 for changeset d221ee6a4c81
12
+ [cc5441ff4666]
13
+
14
+ * .hgsigs:
15
+ Added signature for changeset 57511ffc4e23
16
+ [d221ee6a4c81] [v0.2.3]
17
+
18
+ * History.rdoc, lib/loggability.rb:
19
+ Bumped patch version and updated history.
20
+ [57511ffc4e23]
21
+
22
+ * lib/loggability.rb, spec/loggability_spec.rb:
23
+ Fix logging from subclasses of log clients.
24
+
25
+ Thanks to Mahlon for spotting this and helping to track it down.
26
+ [8b10cb643375]
27
+
28
+ 2012-05-11 Michael Granger <ged@FaerieMUD.org>
29
+
30
+ * .hgtags:
31
+ Added tag v0.2.2 for changeset 7237a700fafc
32
+ [a35c4d3abb52]
33
+
34
+ * .hgsigs:
35
+ Added signature for changeset e41140479376
36
+ [7237a700fafc] [v0.2.2]
37
+
38
+ * History.rdoc, lib/loggability.rb:
39
+ Bump the patch version, update History.
40
+ [e41140479376]
41
+
42
+ * .tm_properties, lib/loggability.rb, lib/loggability/logger.rb:
43
+ Log proxied Modules like Class objects, don't log config specs at
44
+ errror.
45
+ [72aefd428e62]
46
+
1
47
  2012-05-10 Michael Granger <ged@FaerieMUD.org>
2
48
 
49
+ * .hgtags:
50
+ Added tag v0.2.1 for changeset cd911ef44cf0
51
+ [9b09c935a496]
52
+
53
+ * .hgsigs:
54
+ Added signature for changeset 3d9dced14889
55
+ [cd911ef44cf0] [v0.2.1]
56
+
57
+ * History.rdoc, lib/loggability.rb:
58
+ Bumped patch version, updated History.
59
+ [3d9dced14889]
60
+
61
+ * lib/loggability.rb, spec/loggability_spec.rb:
62
+ Fix for configuration via Configurability::Config.
63
+ [7eb1903dafa8]
64
+
65
+ * .hgtags:
66
+ Added tag v0.2.0 for changeset aa672f2fa207
67
+ [6b09a660a076]
68
+
69
+ * .hgsigs:
70
+ Added signature for changeset 4c9840dcb9fd
71
+ [aa672f2fa207] [v0.2.0]
72
+
73
+ * History.rdoc, lib/loggability.rb:
74
+ Fix 1.8 support.
75
+ [4c9840dcb9fd]
76
+
3
77
  * .rvm.gems, README.rdoc, Rakefile, lib/loggability.rb,
4
78
  spec/lib/helpers.rb, spec/loggability/logger_spec.rb,
5
79
  spec/loggability_spec.rb:
6
80
  Add Configurability support.
7
- [555511f82876] [tip]
81
+ [555511f82876]
8
82
 
9
83
  * lib/loggability/logger.rb:
10
84
  Make Logger#inspect output a bit more terse
@@ -62,7 +136,7 @@
62
136
 
63
137
  * README.rdoc:
64
138
  Add some stuff to the README.
65
- [711c4dff84cf] [github/master]
139
+ [711c4dff84cf]
66
140
 
67
141
  * .hgtags:
68
142
  Added tag v0.0.1 for changeset 6dc36a56ff79
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ == v0.3.0 [2012-05-26] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - Add Loggability::SpecHelpers for setting up logging in tests.
4
+ - Downcase the severity before outputting.
5
+
6
+
1
7
  == v0.2.3 [2012-05-18] Michael Granger <ged@FaerieMUD.org>
2
8
 
3
9
  Fix logging from subclasses of log clients. Thanks to Mahlon E.
data/Manifest.txt CHANGED
@@ -11,6 +11,7 @@ lib/loggability/formatter/color.rb
11
11
  lib/loggability/formatter/default.rb
12
12
  lib/loggability/formatter/html.rb
13
13
  lib/loggability/logger.rb
14
+ lib/loggability/spechelpers.rb
14
15
  spec/lib/helpers.rb
15
16
  spec/loggability/formatter/color_spec.rb
16
17
  spec/loggability/formatter/html_spec.rb
@@ -59,7 +59,7 @@ class Loggability::Formatter
59
59
  time.usec, # %2$d
60
60
  Process.pid, # %3$d
61
61
  Thread.current == Thread.main ? 'main' : Thread.object_id, # %4$s
62
- severity, # %5$s
62
+ severity.downcase, # %5$s
63
63
  progname, # %6$s
64
64
  self.msg2str(message, severity) # %7$s
65
65
  ]
@@ -0,0 +1,48 @@
1
+ # -*- ruby -*-
2
+ # vim: set nosta noet ts=4 sw=4:
3
+ # encoding: utf-8
4
+
5
+ require 'loggability' unless defined?( Loggability )
6
+
7
+ # Some helper functions for testing. Usage:
8
+ #
9
+ # RSpec.configure do |c|
10
+ # c.include( Loggability::SpecHelpers )
11
+ # end
12
+ #
13
+ # describe MyClass do
14
+ # before( :all ) { setup_logging }
15
+ # after( :all ) { reset_logging }
16
+ #
17
+ # # ...
18
+ #
19
+ # end
20
+ module Loggability::SpecHelpers
21
+
22
+ ### Reset the logging subsystem to its default state.
23
+ def reset_logging
24
+ Loggability.formatter = nil
25
+ Loggability.output_to( $stderr )
26
+ Loggability.level = :fatal
27
+ end
28
+
29
+
30
+ ### Alter the output of the default log formatter to be pretty in SpecMate output
31
+ ### if HTML_LOGGING is set or TM_FILENAME is set to something containing _spec.rb.
32
+ def setup_logging( level=:fatal )
33
+
34
+ # Only do this when executing from a spec in TextMate
35
+ if ENV['HTML_LOGGING'] || (ENV['TM_FILENAME'] && ENV['TM_FILENAME'] =~ /_spec\.rb/)
36
+ logarray = []
37
+ Thread.current['logger-output'] = logarray
38
+ Loggability.output_to( logarray )
39
+ Loggability.format_as( :html )
40
+ Loggability.level = :debug
41
+ else
42
+ Loggability.level = level
43
+ end
44
+ end
45
+
46
+
47
+ end # Loggability::SpecHelpers
48
+
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.2.3'
12
+ VERSION = '0.3.0'
13
13
 
14
14
  # VCS revision
15
- REVISION = %q$Revision: 57511ffc4e23 $
15
+ REVISION = %q$Revision: 7b6ef57de872 $
16
16
 
17
17
  # The key for the global logger (Loggability's own logger)
18
18
  GLOBAL_KEY = :__global__
data/spec/lib/helpers.rb CHANGED
@@ -22,38 +22,7 @@ end
22
22
 
23
23
 
24
24
  require 'loggability' unless defined?( Loggability )
25
-
26
- #
27
- # Some helper functions for RSpec specifications
28
- #
29
- module Loggability::SpecHelpers
30
-
31
- ### Reset the logging subsystem to its default state.
32
- def reset_logging
33
- Loggability.formatter = nil
34
- Loggability.output_to( $stderr )
35
- Loggability.level = :fatal
36
- end
37
-
38
-
39
- ### Alter the output of the default log formatter to be pretty in SpecMate output
40
- def setup_logging( level=:fatal )
41
-
42
- # Only do this when executing from a spec in TextMate
43
- if ENV['HTML_LOGGING'] || (ENV['TM_FILENAME'] && ENV['TM_FILENAME'] =~ /_spec\.rb/)
44
- logarray = []
45
- Thread.current['logger-output'] = logarray
46
- Loggability.output_to( logarray )
47
- Loggability.format_as( :html )
48
- Loggability.level = :debug
49
- else
50
- Loggability.level = level
51
- end
52
- end
53
-
54
-
55
- end # Loggability::SpecHelpers
56
-
25
+ require 'loggability/spechelpers'
57
26
 
58
27
 
59
28
  ### Mock with RSpec
@@ -24,7 +24,7 @@ describe Loggability::Formatter do
24
24
  it "formats messages with the pattern it's constructed with" do
25
25
  formatter = Loggability::Formatter.new( '[%5$s] %7$s' )
26
26
  formatter.call( 'INFO', Time.at(1336286481), nil, 'Foom.' ).should =~
27
- /\[INFO\] Foom./
27
+ /\[INFO\] Foom./i
28
28
  end
29
29
 
30
30
  it "formats exceptions into useful messages" do
@@ -146,7 +146,7 @@ describe Loggability::Logger do
146
146
  proxy.error( "An error message." )
147
147
  proxy.fatal( "A fatal message." )
148
148
 
149
- messages.first.should =~ /DEBUG \{Object:0x[[:xdigit:]]+\} -- A debug message.\n/
149
+ messages.first.should =~ /DEBUG \{Object:0x[[:xdigit:]]+\} -- A debug message.\n/i
150
150
  end
151
151
 
152
152
  it "has a terse inspection format" do
data.tar.gz.sig CHANGED
Binary file
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.2.3
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,7 +36,7 @@ cert_chain:
36
36
  YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
37
37
  Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
38
38
  cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
39
- date: 2012-05-19 00:00:00.000000000 Z
39
+ date: 2012-05-26 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pluginfactory
@@ -201,6 +201,7 @@ files:
201
201
  - lib/loggability/formatter/default.rb
202
202
  - lib/loggability/formatter/html.rb
203
203
  - lib/loggability/logger.rb
204
+ - lib/loggability/spechelpers.rb
204
205
  - spec/lib/helpers.rb
205
206
  - spec/loggability/formatter/color_spec.rb
206
207
  - spec/loggability/formatter/html_spec.rb
metadata.gz.sig CHANGED
Binary file