alog 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -5
  3. data/lib/alog/version.rb +1 -1
  4. data/lib/alog.rb +4 -3
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c99568a04040e5467af6aa0230606d1b3e7e6d12a19da083ce27574a12a67a1
4
- data.tar.gz: a0f6cfa695a5b1b1874eb2a55cfa88804f1ceccbe34b6e2c07254a01309508ad
3
+ metadata.gz: 3934679913997cf3cf304e6c8cb93c0b9099ee7f547905d2447a0c1390172eea
4
+ data.tar.gz: 66a9c28a7bbd918b479a1939e38de5528688f18d08ef7cac4bc9d4b4fd48cb45
5
5
  SHA512:
6
- metadata.gz: c08f58b90258819bc35b63a40da82aa126645d976edb5b2a625c532dcaf9e44bfecc14b8e4d33915f53c7c6ed25ea8ca842e3f77112589d0987f76238a761cbb
7
- data.tar.gz: 921a75bed5bfb7b861e3bc27fa2bfeb87394055f44c18c8133da03c34b7c0da9d9158cfe8d1bead17f55dc2d1cbe05f86b427ce37dc79b5753c158edbed636c9
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
- @log = AOlogger.new([:stdout])
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
- # This allow application to participate in the conditional logging
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
@@ -1,3 +1,3 @@
1
1
  module Alog
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
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] = :global
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.1.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-17 00:00:00.000000000 Z
11
+ date: 2019-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler