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 +4 -4
- data/lib/Plogger/version.rb +1 -1
- data/lib/Plogger.rb +10 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48b3bd0faa477f65f77adccfc61ba2ec7cd7a912
|
4
|
+
data.tar.gz: b7447c0baeeb91bb74e56155482e14089afa6a40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dd293457cab10e1c3f383deb8e135291f53903d15fe82c2debf60172a9aea34d0530ac87e2d1f3b0581c9ce0f4e62af5490d460f472cf3e6dc72f7826b679d0
|
7
|
+
data.tar.gz: 0af2b26254a349dc638296143f566284d76a46384baeecc90ba6f77f31bb113fa3d659000d563f3c19f90c2fae7ba0aed8911bcf4e9dfd9591d9f5f351d0f163
|
data/lib/Plogger/version.rb
CHANGED
data/lib/Plogger.rb
CHANGED
@@ -4,45 +4,47 @@ require 'Plogger/handler'
|
|
4
4
|
require 'logger'
|
5
5
|
|
6
6
|
module Plogger
|
7
|
-
|
7
|
+
extend self
|
8
|
+
|
9
|
+
def logger
|
8
10
|
@@logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
9
11
|
end
|
10
12
|
|
11
|
-
def
|
13
|
+
def config
|
12
14
|
@@config ||= Plogger::Config.new(logger)
|
13
15
|
end
|
14
16
|
|
15
|
-
def
|
17
|
+
def configure
|
16
18
|
yield(config)
|
17
19
|
@@logger = config.logger
|
18
20
|
@@config = config
|
19
21
|
end
|
20
22
|
|
21
|
-
def
|
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
|
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
|
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
|
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
|
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)
|