itz_logger 0.2.9 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +22 -0
- data/lib/itz_logger/formatter.rb +3 -2
- data/lib/itz_logger/log_terminal.rb +5 -2
- data/lib/itz_logger/logger.rb +2 -1
- data/lib/itz_logger/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 752da29c81d20b8e1126b8c6d217cba564c2f54651be5d028fb2e0b7ac74d7d3
|
4
|
+
data.tar.gz: 6aabe0d9fe4051fb07a166af621e19792123494f9103889e721cf125f4ace368
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 223b9715ba89415fcd70ffa7032e4f9889e62750071dcf1cc049dbc7b1747e99f03107f1e76c725a3177f51d9fad044998816a1e6ffe88c4a578f2b3ac3278e4
|
7
|
+
data.tar.gz: e2c2a5873f9ab04014bc4c6a8246c2576bf5bc340a0173f8dacc0a1b5d850189153a570c6a659ca05c4154090cf4897ec8d0150f1fd889a2f8fb367c71ce6f04
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
itz_logger (0.2.9)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
minitest (5.11.3)
|
10
|
+
rake (12.3.1)
|
11
|
+
|
12
|
+
PLATFORMS
|
13
|
+
ruby
|
14
|
+
|
15
|
+
DEPENDENCIES
|
16
|
+
bundler (~> 1.16)
|
17
|
+
itz_logger!
|
18
|
+
minitest (~> 5.0)
|
19
|
+
rake
|
20
|
+
|
21
|
+
BUNDLED WITH
|
22
|
+
1.16.1
|
data/lib/itz_logger/formatter.rb
CHANGED
@@ -8,10 +8,11 @@
|
|
8
8
|
module ItzLogger
|
9
9
|
class Formatter
|
10
10
|
|
11
|
-
def self.format(message)
|
11
|
+
def self.format(id, message)
|
12
12
|
printf(
|
13
|
-
"%-19s %-#{message.type.length}s %s\n",
|
13
|
+
"%-19s %-s8 %-#{message.type.length}s %s\n",
|
14
14
|
message.created_at.strftime("%b %d %H:%M:%S UTC"),
|
15
|
+
id,
|
15
16
|
message.type.to_s.upcase,
|
16
17
|
message.message)
|
17
18
|
end
|
@@ -6,17 +6,20 @@ module ItzLogger
|
|
6
6
|
class LogTerminal
|
7
7
|
|
8
8
|
@log_level = nil
|
9
|
+
@log_id = nil
|
9
10
|
|
10
11
|
attr_reader :log_level
|
11
12
|
|
12
|
-
def initialize(log_level = ItzLogger::MessageType::INFO)
|
13
|
+
def initialize(log_level = ItzLogger::MessageType::INFO, log_id = nil)
|
14
|
+
puts "die Log-ID: #{log_id}"
|
13
15
|
@log_level = log_level
|
16
|
+
@log_id = log_id
|
14
17
|
end
|
15
18
|
|
16
19
|
def write(log_level, message)
|
17
20
|
return nil if !ItzLogger::MessageType.equals(@log_level, log_level)
|
18
21
|
message = ItzLogger::Message.new(message, log_level)
|
19
|
-
ItzLogger::Formatter.format(message)
|
22
|
+
ItzLogger::Formatter.format(@log_id, message)
|
20
23
|
end
|
21
24
|
|
22
25
|
def log_level=(log_level)
|
data/lib/itz_logger/logger.rb
CHANGED
@@ -9,6 +9,7 @@ module ItzLogger
|
|
9
9
|
class Logger
|
10
10
|
|
11
11
|
@log_strategy = nil
|
12
|
+
@id = nil
|
12
13
|
|
13
14
|
def initialize(options = {})
|
14
15
|
|
@@ -20,7 +21,7 @@ module ItzLogger
|
|
20
21
|
@log_strategy =
|
21
22
|
case log_strategy
|
22
23
|
when ItzLogger::LogStrategy::LOG_TERMINAL
|
23
|
-
ItzLogger::LogTerminal.new(log_level)
|
24
|
+
ItzLogger::LogTerminal.new(log_level, @id)
|
24
25
|
when ItzLogger::LogStrategy::LOG_FILE
|
25
26
|
ItzLogger::LogFile.new(log_level)
|
26
27
|
end
|
data/lib/itz_logger/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itz_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Schaarschmidt
|
@@ -64,6 +64,7 @@ files:
|
|
64
64
|
- ".travis.yml"
|
65
65
|
- CODE_OF_CONDUCT.md
|
66
66
|
- Gemfile
|
67
|
+
- Gemfile.lock
|
67
68
|
- LICENSE.txt
|
68
69
|
- README.md
|
69
70
|
- Rakefile
|