tablexi-logger 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8dc892ad1407d00b78d9c64a9e0311f94f2a7054
4
- data.tar.gz: 3a973eceaa314f7691b771051846fddfc17d59ab
3
+ metadata.gz: 6ab9b9460d4ef2d68a5a80d784694cf9807ada07
4
+ data.tar.gz: 30aa33c861a9700c00da44671782fa62d414abac
5
5
  SHA512:
6
- metadata.gz: c50cb78c129bccfdd68179b5519eb2144a1902bf6165c4257be2c3d671f74684c326bf4c52a1b0324e16368c6eabb17d3f0b8f369b42911f27fe84cc7f586ad6
7
- data.tar.gz: 1f490774706efa87227f70081ccb8864d42195c2734a134d7d486832d585efef81db3d40db0ab6b369a716a78681ea7860811ae81a05c68f13e7b6c31dd019e5
6
+ metadata.gz: fe390b06ede646fb35ab05bc87acfdbc24070fd2f0f557a9f6779392c71f0f1b52412cc39b73290b3111ebd8e9603dda56c49cc5f3c19d371bc26d3b44d36c4f
7
+ data.tar.gz: b246a76f0108140aa17ecf2d1fc77c1f441c62b4b623aef08f0de3bac8712bc0c843c197699db9d02c5bd7a9745c08a539ea2c5d3d86a1f78b94b457ad6555f3
@@ -1,5 +1,9 @@
1
1
  # Changelog (in reverse chronological order)
2
2
 
3
+ ## 1.2.0 (2015-10-09)
4
+
5
+ * Add Ruby 1.9.3 compatibility for legacy projects
6
+
3
7
  ## 1.1.1 (2015-09-02)
4
8
 
5
9
  * Fix lograge detection to account for its lazy determination of whether or not
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Tablexi::Logger
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/tablexi-logger.svg)](http://badge.fury.io/rb/tablexi-logger) [![Circle CI](https://circleci.com/gh/tablexi/tablexi-logger.svg?style=shield)](https://circleci.com/gh/tablexi/tablexi-logger)
4
+
3
5
  Standardized logging for Table XI applications.
4
6
 
5
7
  The default behavior will log to `Rails.logger` or fallback to `::Logger.new($stdout)` if
data/circle.yml CHANGED
@@ -1,12 +1,23 @@
1
1
  machine:
2
2
  ruby:
3
- version: 2.2.2
3
+ version: 2.2.3
4
4
  dependencies:
5
- pre:
6
- - gem install bundler --pre
5
+ cache_directories:
6
+ - 'vendor/bundle'
7
+ override:
8
+ - rvm-exec 2.2.3 bash -c "bundle check --path=vendor/bundle || bundle install --path=vendor/bundle"
9
+ - rvm-exec 2.1.6 bash -c "bundle check --path=vendor/bundle || bundle install --path=vendor/bundle"
10
+ - rvm-exec 2.0.0-p645 bash -c "bundle check --path=vendor/bundle || bundle install --path=vendor/bundle"
11
+ - rvm-exec 1.9.3-p551 bash -c "bundle check --path=vendor/bundle || bundle install --path=vendor/bundle"
7
12
  test:
8
13
  override:
9
- - bundle exec rspec --order rand -fd --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec.xml:
14
+ - rvm-exec 2.2.3 bash -c "bundle exec rspec --order rand -fd --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec-2_2_3.xml":
15
+ parallel: true
16
+ - rvm-exec 2.1.6 bash -c "bundle exec rspec --order rand -fd --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec-2_1_6.xml":
17
+ parallel: true
18
+ - rvm-exec 2.0.0-p645 bash -c "bundle exec rspec --order rand -fd --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec-2_0_0.xml":
19
+ parallel: true
20
+ - rvm-exec 1.9.3-p551 bash -c "bundle exec rspec --order rand -fd --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec-1_9_3.xml":
10
21
  parallel: true
11
22
  post:
12
23
  - bundle exec rubocop
@@ -24,13 +24,15 @@ module Tablexi
24
24
  logger.handlers[severity] << Tablexi::Logger::Standard.new(base_logger, severity: severity)
25
25
  end
26
26
 
27
- trackable_severities = %i(error fatal unknown)
27
+ trackable_severities = [:error, :fatal, :unknown]
28
28
  logger.handle trackable_severities, &Tablexi::Logger::Rollbar if defined?(::Rollbar)
29
29
  logger.handle trackable_severities, &Tablexi::Logger::NewRelic if defined?(::NewRelic)
30
30
  end
31
31
  end
32
32
 
33
- private def bare_logger
33
+ private
34
+
35
+ def bare_logger
34
36
  return @bare_logger if @bare_logger
35
37
  @bare_logger = ::Logger.new($stdout).tap do |config|
36
38
  config.level = ::Logger::DEBUG
@@ -57,7 +59,7 @@ module Tablexi
57
59
 
58
60
  SEVERITIES.each do |severity|
59
61
  define_method(severity) do |exception_or_message, options = {}|
60
- log(severity, exception_or_message, Hash(options))
62
+ log(severity, exception_or_message, Hash[options])
61
63
  end
62
64
  end
63
65
 
@@ -1,14 +1,14 @@
1
1
  module Tablexi
2
2
  class Logger
3
3
  module Severities
4
- SEVERITIES = %i(
5
- debug
6
- info
7
- warn
8
- error
9
- fatal
10
- unknown
11
- ).freeze
4
+ SEVERITIES = [
5
+ :debug,
6
+ :info,
7
+ :warn,
8
+ :error,
9
+ :fatal,
10
+ :unknown,
11
+ ].freeze
12
12
  end
13
13
  end
14
14
  end
@@ -8,7 +8,10 @@ module Tablexi
8
8
  attr_reader :logger
9
9
  attr_reader :severity
10
10
 
11
- def initialize(logger, severity: :unknown)
11
+ def initialize(logger, options = {})
12
+ defaults = { severity: :unknown }
13
+ options = defaults.merge(options)
14
+ severity = options[:severity]
12
15
  raise ArgumentError, "Severity `#{severity}` must be one of #{SEVERITIES}" unless SEVERITIES.include?(severity)
13
16
 
14
17
  @logger = logger
@@ -22,7 +25,7 @@ module Tablexi
22
25
  private
23
26
 
24
27
  def generate_log(exception_or_message, options)
25
- options = Hash(options)
28
+ options = Hash[options]
26
29
 
27
30
  message = []
28
31
  message << (exception_or_message.respond_to?(:message) ? exception_or_message.message : exception_or_message)
@@ -1,5 +1,5 @@
1
1
  module Tablexi
2
2
  class Logger
3
- VERSION = "1.1.1"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -15,11 +15,9 @@ Gem::Specification.new do |spec|
15
15
  spec.license = "MIT"
16
16
 
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
- spec.bindir = "exe"
19
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
18
  spec.require_paths = ["lib"]
21
19
 
22
- spec.add_development_dependency "bundler", "~> 1.10"
20
+ spec.add_development_dependency "bundler", "~> 1.9"
23
21
  spec.add_development_dependency "rake", "~> 10.0"
24
22
  spec.add_development_dependency "rspec", "~> 3.2"
25
23
  spec.add_development_dependency "rspec_junit_formatter"
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tablexi-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Table XI Partners LLC
8
8
  - Bradley Schaefer
9
9
  autorequire:
10
- bindir: exe
10
+ bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-02 00:00:00.000000000 Z
12
+ date: 2015-10-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.10'
20
+ version: '1.9'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '1.10'
27
+ version: '1.9'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.4.6
131
+ rubygems_version: 2.4.8
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: A simple logging wrapper to use in Table XI applications.