plogger 0.4.0 → 0.5.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: 7cd6cd59d8590bfe735635bb7fd583e3ebaadd8d
4
- data.tar.gz: 5c2cc6c8a2b849a77bc86c26cda7981fd6950018
3
+ metadata.gz: 48b3bd0faa477f65f77adccfc61ba2ec7cd7a912
4
+ data.tar.gz: b7447c0baeeb91bb74e56155482e14089afa6a40
5
5
  SHA512:
6
- metadata.gz: adb70c3ca2d60dbdeeb5fda30589fe8b77eef3bf306b469bea9d084ac67a89c1c69d9da69749e0485b9d1f666bed4177eafa4a46a887e0681d60367107ad14c0
7
- data.tar.gz: c45959892c4ea0c6ecfee89fe0dbc287fc5fed45e73d976cbc40e31c1bfb5266b9a8fd41e8449d9c284a990e12cac0f7b2aad88c62a20be593f71ef21310b0f5
6
+ metadata.gz: 3dd293457cab10e1c3f383deb8e135291f53903d15fe82c2debf60172a9aea34d0530ac87e2d1f3b0581c9ce0f4e62af5490d460f472cf3e6dc72f7826b679d0
7
+ data.tar.gz: 0af2b26254a349dc638296143f566284d76a46384baeecc90ba6f77f31bb113fa3d659000d563f3c19f90c2fae7ba0aed8911bcf4e9dfd9591d9f5f351d0f163
@@ -1,3 +1,3 @@
1
1
  module Plogger
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
data/lib/Plogger.rb CHANGED
@@ -4,45 +4,47 @@ require 'Plogger/handler'
4
4
  require 'logger'
5
5
 
6
6
  module Plogger
7
- def self.logger
7
+ extend self
8
+
9
+ def logger
8
10
  @@logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
9
11
  end
10
12
 
11
- def self.config
13
+ def config
12
14
  @@config ||= Plogger::Config.new(logger)
13
15
  end
14
16
 
15
- def self.configure
17
+ def configure
16
18
  yield(config)
17
19
  @@logger = config.logger
18
20
  @@config = config
19
21
  end
20
22
 
21
- def self.exception(exception, type: '', category: '', user_id: '', account_id: '', extra_info: {})
23
+ def exception(exception, type: '', category: '', user_id: '', account_id: '', extra_info: {})
22
24
  handler = Plogger::Handler.new(config)
23
25
  handler.handle_exception(exception, category: category, user_id: user_id, account_id: account_id,
24
26
  extra_info: extra_info)
25
27
  end
26
28
 
27
- def self.error(message, type: '', category: '', user_id: '', account_id: '', extra_info: {})
29
+ def error(message, type: '', category: '', user_id: '', account_id: '', extra_info: {})
28
30
  handler = Plogger::Handler.new(config)
29
31
  handler.handle_error(message, category: category, user_id: user_id, account_id: account_id,
30
32
  extra_info: extra_info)
31
33
  end
32
34
 
33
- def self.warn(message, type: '', category: '', user_id: '', account_id: '', extra_info: {})
35
+ def warn(message, type: '', category: '', user_id: '', account_id: '', extra_info: {})
34
36
  handler = Plogger::Handler.new(config)
35
37
  handler.handle_warning(message, category: category, user_id: user_id, account_id: account_id,
36
38
  extra_info: extra_info)
37
39
  end
38
40
 
39
- def self.info(message, type: '', category: '', user_id: '', account_id: '', extra_info: {})
41
+ def info(message, type: '', category: '', user_id: '', account_id: '', extra_info: {})
40
42
  handler = Plogger::Handler.new(config)
41
43
  handler.handle_info(message, category: category, user_id: user_id, account_id: account_id,
42
44
  extra_info: extra_info)
43
45
  end
44
46
 
45
- def self.debug(message, type: '', category: '', user_id: '', account_id: '', extra_info: {})
47
+ def debug(message, type: '', category: '', user_id: '', account_id: '', extra_info: {})
46
48
  handler = Plogger::Handler.new(config)
47
49
  handler.handle_debug(message, category: category, user_id: user_id, account_id: account_id,
48
50
  extra_info: extra_info)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Merrill