itslog 0.1.1 → 0.2.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.
@@ -4,7 +4,7 @@ module Itslog
4
4
  attr_accessor :namespace
5
5
 
6
6
  def namespace
7
- @namespace ||= 'unknown'
7
+ @namespace ||= ''
8
8
  end
9
9
 
10
10
  def add_with_format(severity, message = nil, progname = nil, &block)
@@ -15,8 +15,9 @@ module Itslog
15
15
  msg = ''
16
16
  msg << colors[severity]
17
17
  msg << "#{time.split.first} " unless Rails.env.development? || Rails.env.test?
18
- msg << "#{time.split.last} "
19
- msg << "#{namespace}: "
18
+ msg << "#{time.split.last}"
19
+ msg << " #{namespace}" if namespace.present?
20
+ msg << ': '
20
21
  msg << colors[5]
21
22
  msg << message.to_s.strip
22
23
 
@@ -33,7 +34,9 @@ module Itslog
33
34
 
34
35
  def call_with_namespace(message, *args)
35
36
  namespace = message.split('.').last if logger
36
- logger.namespace = namespace.present? ? namespace : ''
37
+ if logger.respond_to?(:namespace=)
38
+ logger.namespace = namespace.present? ? namespace : ''
39
+ end
37
40
  call_without_namespace(message, *args)
38
41
  end
39
42
 
@@ -1,3 +1,3 @@
1
1
  module Itslog
2
- VERSION = '0.1.1'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itslog
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 1
10
- version: 0.1.1
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Thomas Marino
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-03 00:00:00 -04:00
18
+ date: 2011-05-05 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21