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 +4 -4
- data/.gitignore +2 -0
- data/Rakefile +2 -0
- data/lib/tlogger.rb +34 -0
- data/lib/tlogger/version.rb +1 -1
- data/tlogger.gemspec +2 -0
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cf3256d26a571615fe3121d443904dcbeb8cf54ea1761a1d52704d36f5a9418
|
4
|
+
data.tar.gz: e0c620dca8f28c1f2177bd4e460c68b43bd4a31be6906cf304423240481a59b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26a1ecb562014272126bcbe5669ca7e6cee341d93f1c0bca7f52a85f099f60d7e8f5557001ad032ce00379f295ec14a749242020f7b5e9797c4bc25ee28b7f28
|
7
|
+
data.tar.gz: b22ed97e724d855d993533cd5062920c85934358e2e1e62fb691d81e4045c28e2335a93f3b8c7c83dd3646dffb985b3e9bc89abd897ef5f6ee5966565c86c4e8
|
data/Rakefile
CHANGED
data/lib/tlogger.rb
CHANGED
@@ -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
|
data/lib/tlogger/version.rb
CHANGED
data/tlogger.gemspec
CHANGED
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.
|
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:
|
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.
|
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: []
|