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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 290af155a18755e05214f0d49442951e2c193c9ff575a3f52c0dfecec115eb86
4
- data.tar.gz: f4056760e55a92b26b8ec971732178a9f4d2034a4613ddac26b68aa102f46e1b
3
+ metadata.gz: 752da29c81d20b8e1126b8c6d217cba564c2f54651be5d028fb2e0b7ac74d7d3
4
+ data.tar.gz: 6aabe0d9fe4051fb07a166af621e19792123494f9103889e721cf125f4ace368
5
5
  SHA512:
6
- metadata.gz: f2e0b9f7985b5d17f5cdc1905ccdd0264bc3a632a57c96802b49b5d371a78b4e68d35bd91bf6f6d29857b1d09e46752d6b93a7b814b60874aebda5d4873221f1
7
- data.tar.gz: 232229f967ba188be2fb1482e169632b7e4b74e1889829583df4a58cc8e2687465c525fe8f528d76c4c386a2f4f2b2ed296a569d78a4606cba57f215d08df540
6
+ metadata.gz: 223b9715ba89415fcd70ffa7032e4f9889e62750071dcf1cc049dbc7b1747e99f03107f1e76c725a3177f51d9fad044998816a1e6ffe88c4a578f2b3ac3278e4
7
+ data.tar.gz: e2c2a5873f9ab04014bc4c6a8246c2576bf5bc340a0173f8dacc0a1b5d850189153a570c6a659ca05c4154090cf4897ec8d0150f1fd889a2f8fb367c71ce6f04
data/Gemfile CHANGED
@@ -4,3 +4,5 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in itz_logger.gemspec
6
6
  gemspec
7
+
8
+ gem "rake"
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
@@ -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)
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ItzLogger
2
- VERSION = "0.2.9"
2
+ VERSION = "0.2.10"
3
3
  end
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.9
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