alog 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -5
- data/lib/alog/version.rb +1 -1
- data/lib/alog.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3934679913997cf3cf304e6c8cb93c0b9099ee7f547905d2447a0c1390172eea
|
4
|
+
data.tar.gz: 66a9c28a7bbd918b479a1939e38de5528688f18d08ef7cac4bc9d4b4fd48cb45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e991c2d68ff49aff53007f6d137b196e2bbec98f888ea54551c01ed2262830ead198585ed3e6e58eb4fcd71061df7549678cd2de757b3a33788a29b1c482d66
|
7
|
+
data.tar.gz: a75cfce0d34a26d26091d5f9df9d04f513d4e25a89ac40f26f0da3c4560f84cc4062a3dd4357e7304f575c9502b1e3e8a3a295bc73ec560231b15469a6278626
|
data/README.md
CHANGED
@@ -108,18 +108,17 @@ class MyApp
|
|
108
108
|
# Method 3 : Create the AOlogger object
|
109
109
|
# AOlogger is meant to be proxy for standard Logger, with the tagging and multiple log engines included
|
110
110
|
# The initialize parameter is an array containing key to the LogFacts above...
|
111
|
-
# In the following case, the AOlogger shall only configured to :stdout configuration (refers above)
|
112
|
-
|
111
|
+
# In the following case, the AOlogger shall only configured to :stdout configuration (refers above)
|
112
|
+
# and all logging shall be tagged with key :feature_m
|
113
|
+
@log = AOlogger.new(:feature_m, [:stdout])
|
113
114
|
...
|
114
115
|
...
|
115
116
|
# This behave like standard logging engine
|
116
117
|
@log.debug "Code reached here..."
|
117
|
-
...
|
118
118
|
@log.error "Oppss... We did it again!"
|
119
119
|
...
|
120
120
|
...
|
121
|
-
#
|
122
|
-
# If the tag :feature_x is not activated, the message will not be printed.
|
121
|
+
# this API is more explicit and replace all global values
|
123
122
|
@log.log("this only shown if tag :feature_x is activated", :debug, :feature_x, [:app_file])
|
124
123
|
|
125
124
|
end
|
data/lib/alog/version.rb
CHANGED
data/lib/alog.rb
CHANGED
@@ -41,20 +41,21 @@ module Alog
|
|
41
41
|
#
|
42
42
|
class AOlogger
|
43
43
|
attr_reader :logEng
|
44
|
-
def initialize(logEng = [])
|
44
|
+
def initialize(key = :global, logEng = [])
|
45
45
|
@myMethods = [:debug, :error, :warn, :warning]
|
46
|
+
@defKey = key
|
46
47
|
@logEng = logEng || []
|
47
48
|
end
|
48
49
|
|
49
50
|
def log(msg, ltype = :debug, key = :global, logEng = [])
|
50
|
-
CondLog.call(msg, { key: key, type: ltype, logEng: logEng || @logEng })
|
51
|
+
CondLog.call(msg, { key: key || @defKey, type: ltype, logEng: logEng || @logEng })
|
51
52
|
end
|
52
53
|
|
53
54
|
def method_missing(mtd, *args, &block)
|
54
55
|
if @myMethods.include?(mtd)
|
55
56
|
params = {}
|
56
57
|
pa = args[1]
|
57
|
-
params[:key] =
|
58
|
+
params[:key] = @defKey
|
58
59
|
params[:logEng] = @logEng
|
59
60
|
# TODO cases here may not be extensive to
|
60
61
|
# the original Logger supported.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Liaw
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|