tlogger 0.22.0 → 0.25.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
  SHA256:
3
- metadata.gz: e2097702e7fcefd385c55d485f0ef8f26c16b6a4f523064be6f05e497ae510b5
4
- data.tar.gz: 295a7c220f3df575dd88c6062bf1c6f77a6f902122dc5adba06b86481b268df6
3
+ metadata.gz: 7cf3256d26a571615fe3121d443904dcbeb8cf54ea1761a1d52704d36f5a9418
4
+ data.tar.gz: e0c620dca8f28c1f2177bd4e460c68b43bd4a31be6906cf304423240481a59b9
5
5
  SHA512:
6
- metadata.gz: ca42907248b81dc572c21475b7db339d2f3caaa017854f0b9af465f7950b524a270180f7dcae7572f96b5f97ce08060f9083809c5620884e56860883c4583cf8
7
- data.tar.gz: c8f1fe748c293b53cbe30c540b591cfc6c23ea9323ec65420d3f2f2c4be40910ba1ba423b0950d81ebfd86d3bd9f775dd642f1680302448b6822e915e34a59a1
6
+ metadata.gz: 26a1ecb562014272126bcbe5669ca7e6cee341d93f1c0bca7f52a85f099f60d7e8f5557001ad032ce00379f295ec14a749242020f7b5e9797c4bc25ee28b7f28
7
+ data.tar.gz: b22ed97e724d855d993533cd5062920c85934358e2e1e62fb691d81e4045c28e2335a93f3b8c7c83dd3646dffb985b3e9bc89abd897ef5f6ee5966565c86c4e8
data/.gitignore CHANGED
@@ -8,3 +8,5 @@
8
8
  /tmp/
9
9
 
10
10
  *.log
11
+ *.gem
12
+ Gemfile.lock
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
3
 
4
+ require 'devops_helper'
5
+
4
6
  Rake::TestTask.new(:test) do |t|
5
7
  t.libs << "test"
6
8
  t.libs << "lib"
@@ -14,6 +14,40 @@ module Tlogger
14
14
  def new(*args,&block)
15
15
  ::Tlogger::Tlogger.new(*args,&block)
16
16
  end
17
+
18
+ # detect if the prompt should be to env or file
19
+ def init
20
+ if is_dev?
21
+ new(STDOUT)
22
+ else
23
+ c = output_channel
24
+ new(*c[:path])
25
+ end
26
+ end
27
+
28
+ private
29
+ def is_dev?
30
+ ENV.keys.include?("TLOGGER_MODE") and ENV["TLOGGER_MODE"].downcase == "dev"
31
+ end
32
+
33
+ def output_channel
34
+ out = ENV["TLOGGER_OUT"]
35
+ if not out.nil?
36
+ case out
37
+ when "file"
38
+ path = ENV["TLOGGER_OUTPATH"]
39
+ if path =~ /,/
40
+ { mode: :file, path: path.split(",") }
41
+ else
42
+ { mode: :file, path: [path] }
43
+ end
44
+ else
45
+ { mode: :file, path: [nil] }
46
+ end
47
+ else
48
+ { mode: :stdio, path: [nil] }
49
+ end
50
+ end
17
51
  end # class self
18
52
 
19
53
  end
@@ -1,3 +1,3 @@
1
1
  module Tlogger
2
- VERSION = "0.22.0"
2
+ VERSION = "0.25.0"
3
3
  end
@@ -27,4 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.bindir = "exe"
28
28
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
29
  spec.require_paths = ["lib"]
30
+
31
+ spec.add_development_dependency "devops_helper"
30
32
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tlogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-13 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2021-01-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: devops_helper
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: Logger that provides some control over how the log messages are being
14
28
  displayed with conditionally enable and disable certain log messages from showing
15
29
  based on configurations
@@ -39,7 +53,7 @@ licenses:
39
53
  - MIT
40
54
  metadata:
41
55
  homepage_uri: https://github.com/chrisliaw/tlogger
42
- post_install_message:
56
+ post_install_message:
43
57
  rdoc_options: []
44
58
  require_paths:
45
59
  - lib
@@ -54,8 +68,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
68
  - !ruby/object:Gem::Version
55
69
  version: '0'
56
70
  requirements: []
57
- rubygems_version: 3.1.4
58
- signing_key:
71
+ rubygems_version: 3.1.2
72
+ signing_key:
59
73
  specification_version: 4
60
74
  summary: Logger that added contextual information to the log messages
61
75
  test_files: []