sapience 0.1.12 → 0.1.13

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: 36ccc40e114e91edcfc10a69c1937171ea34c178
4
- data.tar.gz: e11d3e90932e8d19be1e932afaa275ef191f9a49
3
+ metadata.gz: 5acd3b3dd076bc64f596d3274c065e91cde33534
4
+ data.tar.gz: b6001baf41664e17f82ae512b956b8be67d66775
5
5
  SHA512:
6
- metadata.gz: c57125d9b56330254a7ae6ed2f512f35fc9221d71701612d8ecc070f317f908a7da04d15dd9c0485f9d35604c156833463a5c3ecddd5c9bda201ea98ee5517c2
7
- data.tar.gz: aa97574105f6bc0899e8523aaf6ef4c89695cef24b4f302510ceb3b5b031e0145b35aa9c938dcfd179d2edeb991847dfcd6aa8ff797334082d3857f821aa088a
6
+ metadata.gz: c588da952333b0717112b02bf956c4721394a9b3e25a0faf562889aaf79bbdc6d6abedffc6af48b2cfc9915fe8d3edbf1b4a37fcc46056d6c58ee1b1f5710720
7
+ data.tar.gz: a2f04ee0e9b06c8367cf909add482fba8eb9955923fbfb472f2c0808d0fddf517d1cb1acd3ccd36d5600c3bdbc7ea09adb64dc3ee3ef3762b39b38c1d477d0d7
data/README.md CHANGED
@@ -39,7 +39,7 @@ Sapience.configure do |config|
39
39
  config.backtrace_level = :error
40
40
  config.application = "my-app"
41
41
  config.appenders = [
42
- { file: { io: STDOUT, formatter: :color } },
42
+ { stream: { io: STDOUT, formatter: :color } },
43
43
  { sentry: { dsn: "https://username:password@app.getsentry.com/00000" } },
44
44
  { datadog: { url: "udp://localhost:8125" } },
45
45
  ]
@@ -53,28 +53,28 @@ Sapience provides a default configuration that will be used unless another file
53
53
  default:
54
54
  log_level: info
55
55
  appenders:
56
- - file:
56
+ - stream:
57
57
  io: STDOUT
58
58
  formatter: color
59
59
 
60
60
  test:
61
61
  log_level: warn
62
62
  appenders:
63
- - file:
63
+ - stream:
64
64
  file_name: log/test.log
65
65
  formatter: color
66
66
 
67
67
  development:
68
68
  log_level: debug
69
69
  appenders:
70
- - file:
70
+ - stream:
71
71
  file_name: log/development.log
72
72
  formatter: color
73
73
 
74
74
  production:
75
75
  log_level: warn
76
76
  appenders:
77
- - file:
77
+ - stream:
78
78
  file_name: log/production.log
79
79
  formatter: json
80
80
  ```
@@ -86,13 +86,13 @@ One of the things that did not suite us so well with the Semantic Logger approac
86
86
  There are a number of appenders that all listen to different events and act on its data. It is possible to specify the `level` and `backtrace_level` for each appender by providing (example) `level: :error` to the add_appender method.
87
87
 
88
88
 
89
- ### File
89
+ ### Stream
90
90
 
91
- File appenders are basically a log stream. You can add as many file appenders as you like logging to different locations.
91
+ Stream appenders are basically a log stream. You can add as many stream appenders as you like logging to different locations.
92
92
 
93
93
  ```ruby
94
- Sapience.add_appender(:file, file_name: "log/sapience.log", formatter: :json)
95
- Sapience.add_appender(:file, io: STDOUT, formatter: :color, level: :trace)
94
+ Sapience.add_appender(:stream, file: "log/sapience.log", formatter: :json)
95
+ Sapience.add_appender(:stream, io: STDOUT, formatter: :color, level: :trace)
96
96
  ```
97
97
 
98
98
  ### Sentry
@@ -2,27 +2,27 @@
2
2
  default:
3
3
  log_level: info
4
4
  appenders:
5
- - file:
5
+ - stream:
6
6
  io: STDOUT
7
7
  formatter: color
8
8
 
9
9
  test:
10
10
  log_level: warn
11
11
  appenders:
12
- - file:
12
+ - stream:
13
13
  file_name: log/test.log
14
14
  formatter: color
15
15
 
16
16
  development:
17
17
  log_level: debug
18
18
  appenders:
19
- - file:
19
+ - stream:
20
20
  file_name: log/development.log
21
21
  formatter: color
22
22
 
23
23
  production:
24
24
  log_level: warn
25
25
  appenders:
26
- - file:
26
+ - stream:
27
27
  file_name: log/production.log
28
28
  formatter: json
@@ -23,7 +23,7 @@ require "sapience/logger"
23
23
  require "sapience/loggable"
24
24
  require "sapience/subscriber"
25
25
 
26
- require "sapience/appender/file"
26
+ require "sapience/appender/stream"
27
27
  require "sapience/appender/sentry"
28
28
  require "sapience/appender/wrapper"
29
29
  require "sapience/appender/datadog"
@@ -1,12 +1,12 @@
1
- # File appender
1
+ # Stream appender
2
2
  #
3
- # Writes log messages to a file or open iostream
3
+ # Writes log messages to a file or open IO stream
4
4
  #
5
5
  module Sapience
6
6
  module Appender
7
- class File < Sapience::Subscriber
7
+ class Stream < Sapience::Subscriber
8
8
 
9
- # Create a File Logger appender instance.
9
+ # Create a Stream Logger appender instance.
10
10
  #
11
11
  # Parameters
12
12
  # :file_name [String|IO]
@@ -35,10 +35,10 @@ module Sapience
35
35
  # Sapience.config.default_level = :info
36
36
  #
37
37
  # # Log to screen
38
- # Sapience.add_appender(:file, io: STDOUT, formatter: :color)
38
+ # Sapience.add_appender(:stream, io: STDOUT, formatter: :color)
39
39
  #
40
40
  # # And log to a file at the same time
41
- # Sapience::Logger.add_appender(:file, file_name: 'application.log', formatter: :color)
41
+ # Sapience::Logger.add_appender(:stream, file_name: 'application.log', formatter: :color)
42
42
  #
43
43
  # logger = Sapience['test']
44
44
  # logger.info 'Hello World'
@@ -51,17 +51,17 @@ module Sapience
51
51
  # Sapience.config.default_level = :trace
52
52
  #
53
53
  # # Log to screen but only display :info and above
54
- # Sapience.add_appender(:file, io: STDOUT, level: :info)
54
+ # Sapience.add_appender(:stream, io: STDOUT, level: :info)
55
55
  #
56
56
  # # And log to a file at the same time, including all :trace level data
57
- # Sapience.add_appender(:file, file_name: 'application.log')
57
+ # Sapience.add_appender(:stream, file_name: 'application.log')
58
58
  #
59
59
  # logger = Sapience['test']
60
60
  # logger.info 'Hello World'
61
61
  # rubocop:disable AbcSize, CyclomaticComplexity, PerceivedComplexity
62
62
  def initialize(options = {}, &block)
63
63
  unless options[:io] || options[:file_name]
64
- fail "Sapience::Appender::File missing mandatory parameter :file_name or :io"
64
+ fail "Sapience::Appender::Stream missing mandatory parameter :file_name or :io"
65
65
  end
66
66
 
67
67
  opts = options.dup
@@ -52,10 +52,10 @@ module Sapience
52
52
  # Sapience.config.default_level = :info
53
53
  #
54
54
  # # Log to screen
55
- # Sapience.add_appender(:file, io: STDOUT, formatter: :color)
55
+ # Sapience.add_appender(:stream, io: STDOUT, formatter: :color)
56
56
  #
57
57
  # # And log to a file at the same time
58
- # Sapience.add_appender(:file, file_name: 'application.log', formatter: :color)
58
+ # Sapience.add_appender(:stream, file_name: 'application.log', formatter: :color)
59
59
  #
60
60
  # logger = Sapience['MyApplication']
61
61
  # logger.debug("Only display this if log level is set to Debug or lower")
@@ -12,7 +12,7 @@ module Sapience
12
12
  application: "Sapience",
13
13
  host: nil,
14
14
  ap_options: { multiline: false },
15
- appenders: [{ file: { io: STDOUT, formatter: :color } }],
15
+ appenders: [{ stream: { io: STDOUT, formatter: :color } }],
16
16
  }.freeze
17
17
 
18
18
  # Initial default Level for all new instances of Sapience::Logger
@@ -22,7 +22,7 @@ module Sapience
22
22
 
23
23
  # Adds color to the default log formatter
24
24
  # Example:
25
- # Sapience.add_appender(:file, io: $stdout, formatter: :color)
25
+ # Sapience.add_appender(:stream, io: $stdout, formatter: :color)
26
26
  def call(log, _logger) # rubocop:disable AbcSize, PerceivedComplexity, CyclomaticComplexity
27
27
  colors = Sapience::AnsiColors
28
28
  level_color = colors::LEVEL_MAP[log.level]
@@ -125,7 +125,7 @@ module Sapience
125
125
  # By default logs to STDERR
126
126
  def self.logger
127
127
  @@logger ||= begin
128
- l = Sapience::Appender::File.new(io: STDERR, level: :warn)
128
+ l = Sapience::Appender::Stream.new(io: STDERR, level: :warn)
129
129
  l.name = name
130
130
  l
131
131
  end
@@ -10,7 +10,7 @@ require "socket"
10
10
  # config.host = ENV.fetch('SAPIENCE_HOST', nil)
11
11
  # config.ap_options = { multiline: false }
12
12
  # config.appenders = [
13
- # { file: { io: STDOUT, formatter: :color } },
13
+ # { stream: { io: STDOUT, formatter: :color } },
14
14
  # { statsd: { url: 'udp://localhost:2222' } },
15
15
  # { sentry: { dsn: 'https://foobar:443' } },
16
16
  # ]
@@ -134,14 +134,14 @@ module Sapience
134
134
  # Examples:
135
135
  #
136
136
  # # Send all logging output to Standard Out (Screen)
137
- # Sapience.add_appender(:file, io: STDOUT)
137
+ # Sapience.add_appender(:stream, io: STDOUT)
138
138
  #
139
139
  # # Send all logging output to a file
140
- # Sapience.add_appender(:file, file_name: 'logfile.log')
140
+ # Sapience.add_appender(:stream, file_name: 'logfile.log')
141
141
  #
142
142
  # # Send all logging output to a file and only :info and above to standard output
143
- # Sapience.add_appender(:file, file_name: 'logfile.log')
144
- # Sapience.add_appender(:file, io: STDOUT, level: :info)
143
+ # Sapience.add_appender(:stream, file_name: 'logfile.log')
144
+ # Sapience.add_appender(:stream, io: STDOUT, level: :info)
145
145
  #
146
146
  # Log to log4r, Logger, etc.:
147
147
  #
@@ -168,7 +168,7 @@ module Sapience
168
168
 
169
169
  # Start appender thread if it is not already running
170
170
  Sapience::Logger.start_appender_thread
171
- Sapience.logger = appender if appender.is_a?(Sapience::Appender::File)
171
+ Sapience.logger = appender if appender.is_a?(Sapience::Appender::Stream)
172
172
  Sapience.metrix = appender if appender.is_a?(Sapience::Appender::Datadog)
173
173
  appender
174
174
  end
@@ -1,3 +1,3 @@
1
1
  module Sapience
2
- VERSION = "0.1.12"
2
+ VERSION = "0.1.13"
3
3
  end
@@ -2,13 +2,13 @@
2
2
  default:
3
3
  log_level: error
4
4
  appenders:
5
- - file:
5
+ - stream:
6
6
  file_name: log/error.log
7
7
  formatter: default
8
8
 
9
9
  test:
10
10
  log_level: fatal
11
11
  appenders:
12
- - file:
12
+ - stream:
13
13
  file_name: log/fatal.log
14
14
  formatter: json
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sapience
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-26 00:00:00.000000000 Z
12
+ date: 2016-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby
@@ -209,8 +209,8 @@ files:
209
209
  - lib/sapience.rb
210
210
  - lib/sapience/ansi_colors.rb
211
211
  - lib/sapience/appender/datadog.rb
212
- - lib/sapience/appender/file.rb
213
212
  - lib/sapience/appender/sentry.rb
213
+ - lib/sapience/appender/stream.rb
214
214
  - lib/sapience/appender/wrapper.rb
215
215
  - lib/sapience/base.rb
216
216
  - lib/sapience/concerns/compatibility.rb
@@ -358,7 +358,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
358
358
  version: '0'
359
359
  requirements: []
360
360
  rubyforge_project:
361
- rubygems_version: 2.6.6
361
+ rubygems_version: 2.5.1
362
362
  signing_key:
363
363
  specification_version: 4
364
364
  summary: Hasslefree autoconfiguration for logging, metrics and exception collection.