tlogger 0.25.0 → 0.26.2

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
  SHA256:
3
- metadata.gz: 7cf3256d26a571615fe3121d443904dcbeb8cf54ea1761a1d52704d36f5a9418
4
- data.tar.gz: e0c620dca8f28c1f2177bd4e460c68b43bd4a31be6906cf304423240481a59b9
3
+ metadata.gz: 6f999c21a9d4ba07f90d307edfec87eda42b4b72ee8b40b1c03ebb5996f14562
4
+ data.tar.gz: bd8a18877d7057263befec0cc93a939259bca1ab8c6084365d3bd055b732e489
5
5
  SHA512:
6
- metadata.gz: 26a1ecb562014272126bcbe5669ca7e6cee341d93f1c0bca7f52a85f099f60d7e8f5557001ad032ce00379f295ec14a749242020f7b5e9797c4bc25ee28b7f28
7
- data.tar.gz: b22ed97e724d855d993533cd5062920c85934358e2e1e62fb691d81e4045c28e2335a93f3b8c7c83dd3646dffb985b3e9bc89abd897ef5f6ee5966565c86c4e8
6
+ metadata.gz: '092162f6c93adbfbff4cc3bbc1af619d10159be08960a23f352becbbb3038297ff5d67ed65a841d33b289bef62839ed7f1b270666be6e82f7d926c0ebcc868b8'
7
+ data.tar.gz: 549e00b20bfa3ab36fcf01b68e54542d36df127bb84377c6c909d27f75b3bbec27e5446552bf37861071faa7d77829ac10a9bd24f793c2e2db7dc90a4a129e4f
data/Rakefile CHANGED
@@ -1,7 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
3
 
4
- require 'devops_helper'
4
+ #require 'devops_helper'
5
+ require 'devops_assist'
5
6
 
6
7
  Rake::TestTask.new(:test) do |t|
7
8
  t.libs << "test"
@@ -1,3 +1,3 @@
1
1
  module Tlogger
2
- VERSION = "0.25.0"
2
+ VERSION = "0.26.2"
3
3
  end
data/lib/tlogger.rb CHANGED
@@ -8,7 +8,7 @@ require_relative "tlogger/logger_group"
8
8
  #
9
9
  module Tlogger
10
10
  class Error < StandardError; end
11
-
11
+
12
12
  # shorten the initializer to Tlogger.new instead of the longer Tlogger::Tlogger.new
13
13
  class << self
14
14
  def new(*args,&block)
@@ -25,11 +25,20 @@ module Tlogger
25
25
  end
26
26
  end
27
27
 
28
- private
28
+ def set_dev_mode
29
+ ENV["TLOGGER_MODE"] = "dev"
30
+ end
31
+
32
+ def set_production_mode
33
+ ENV.delete("TLOGGER_MODE")
34
+ end
35
+
29
36
  def is_dev?
30
37
  ENV.keys.include?("TLOGGER_MODE") and ENV["TLOGGER_MODE"].downcase == "dev"
31
38
  end
32
39
 
40
+
41
+ private
33
42
  def output_channel
34
43
  out = ENV["TLOGGER_OUT"]
35
44
  if not out.nil?
@@ -50,5 +59,7 @@ module Tlogger
50
59
  end
51
60
  end # class self
52
61
 
62
+
53
63
  end
54
64
 
65
+
@@ -0,0 +1,33 @@
1
+
2
+ require_relative 'tlogger'
3
+
4
+ module Tlogger
5
+ module TloggerHelper
6
+
7
+ module ClassMethods
8
+ def tlogger(opts = { })
9
+ defOpts = { tag: nil, dev_mode: false }.merge!(opts)
10
+
11
+ if @tlogger.nil?
12
+ @tlogger = ::Tlogger.init
13
+ ::Tlogger.set_dev_mode if defOps[:dev_mode] == true
14
+ @tlogger.tag = tag if not (defOpts[:tag].nil? and defOps[:tag].empty?)
15
+ end
16
+ @tlogger
17
+ end
18
+
19
+ end
20
+
21
+ def self.included(klass)
22
+ klass.extend(ClassMethods)
23
+ end
24
+
25
+ def tlogger
26
+ self.class.tlogger
27
+ end
28
+
29
+ end
30
+ end
31
+
32
+ TloggerHelper = Tlogger::TloggerHelper
33
+
data/tlogger.gemspec CHANGED
@@ -28,5 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
30
 
31
- spec.add_development_dependency "devops_helper"
31
+ #spec.add_development_dependency "devops_helper"
32
+ spec.add_development_dependency "devops_assist"
33
+
32
34
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tlogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.26.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-17 00:00:00.000000000 Z
11
+ date: 2021-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: devops_helper
14
+ name: devops_assist
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -45,6 +45,7 @@ files:
45
45
  - lib/tlogger/logger_group.rb
46
46
  - lib/tlogger/tlogger.rb
47
47
  - lib/tlogger/version.rb
48
+ - lib/tlogger_helper.rb
48
49
  - samples/basic.rb
49
50
  - samples/group.rb
50
51
  - tlogger.gemspec
@@ -68,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
69
  - !ruby/object:Gem::Version
69
70
  version: '0'
70
71
  requirements: []
71
- rubygems_version: 3.1.2
72
+ rubygems_version: 3.2.22
72
73
  signing_key:
73
74
  specification_version: 4
74
75
  summary: Logger that added contextual information to the log messages