exologger 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0ea86ab7c2ee081011c5e0cd113bb90c205039b
4
- data.tar.gz: 545aae4d51274a5ea754e58b9f475f21578ed0c9
3
+ metadata.gz: 330c01523b4302e47b94077f8982e841c49f54ab
4
+ data.tar.gz: b95fc726b25f893a8bfa45e205fcad69b2007e65
5
5
  SHA512:
6
- metadata.gz: 2303cdce8dfdb6b08618d7d4d7d60dfed0a0ad62668541fa320fc032684284540d7d77cb30fb4839da8f4457af67eb4d54f23878109edf33293d60c29bd7b7ce
7
- data.tar.gz: f0fbd97df08008963f2eff370471c3e4800476ca4381ce2d2a65fe5cfa0cfab051b04a10c00dc80098a43598b748ee98c541d57b5604b724bf6391f4557ae05e
6
+ metadata.gz: 474552cbe988608c0c175a5c6359a0c2dc39328dacf1c6e5fbdc509fcfd1951da47758fc1895f07dacc3596973a1ddd64bb277e1411e0265a67f46d70e0a11d8
7
+ data.tar.gz: cf17bb2deab228dde1d697796a677fd82221939c278c51907f1ac80c52c8241633728291db2b3611552a95b5c746541bf33ba94549497a0d97f6aca3e2ed8ca9
@@ -1,7 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'log4r'
3
3
 
4
- $pattern_formatter_params = {:pattern => "%l, %d, %c, %M", :date_pattern => "%Y-%m-%d %H:%M:%S"}
4
+ $pattern_formatter_params = {:pattern => "%l, %d, %c, %M", :date_pattern => "%Y-%m-%d %H:%M:%S.%L %:z"}
5
5
  $pattern_formatter = Log4r::PatternFormatter.new $pattern_formatter_params
6
6
  $stdout_outputter = Log4r::Outputter.stdout
7
7
  $stdout_outputter.formatter = $pattern_formatter
@@ -3,7 +3,7 @@ require_relative "../lib/exologger.rb"
3
3
 
4
4
  class ExologgerTest < Test::Unit::TestCase
5
5
 
6
- def testLoggerInstantiation
6
+ def test_logger_instantiation
7
7
  logger = Exologger.get_logger "logger1"
8
8
  assert_instance_of(Log4r::Logger, logger, 'logger is not an instance of log4r')
9
9
  assert_equal(1, logger.outputters.size, "Expected only one outputter. But, found more than one")
@@ -12,28 +12,28 @@ class ExologgerTest < Test::Unit::TestCase
12
12
  assert_equal("logger1", logger.name)
13
13
  end
14
14
 
15
- def testLogMessageFormat
15
+ def test_log_message_format
16
16
  logger = Exologger.get_logger "logger2"
17
- stringIO = StringIO.new
18
- stringIOOutputter = Log4r::IOOutputter.new("stringio", stringIO)
19
- stringIOOutputter.formatter = Exologger.get_formatter
20
- logger.outputters = [stringIOOutputter]
17
+ string_io = StringIO.new
18
+ string_io_outputter = Log4r::IOOutputter.new("stringio", string_io)
19
+ string_io_outputter.formatter = Exologger.get_formatter
20
+ logger.outputters = [string_io_outputter]
21
21
  logger.debug "test message1"
22
- if !(stringIO.string =~ /DEBUG, [0-9]{1,4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}, logger2, test message1/)
23
- logs = stringIO.string
22
+ if !(string_io.string =~ /DEBUG, [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} \+[0-9]{2}:[0-9]{2}, logger2, test message1/)
23
+ logs = string_io.string
24
24
  assert(false, "wrong log message format: #{logs}")
25
25
  end
26
26
  end
27
27
 
28
- def testMultiLineLogMessage
28
+ def test_multiline_log_message
29
29
  logger = Exologger.get_logger "logger3"
30
- stringIO = StringIO.new
31
- stringIOOutputter = Log4r::IOOutputter.new("stringio", stringIO)
32
- stringIOOutputter.formatter = Exologger.get_formatter
33
- logger.outputters = [stringIOOutputter]
30
+ string_io = StringIO.new
31
+ string_io_outputter = Log4r::IOOutputter.new("stringio", string_io)
32
+ string_io_outputter.formatter = Exologger.get_formatter
33
+ logger.outputters = [string_io_outputter]
34
34
  logger.info "test multiline message \n line1 \n line2 \t\n line3 \t\n\n"
35
- if !(stringIO.string =~ /INFO, [0-9]{1,4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}, logger3, test multiline message \n line1 \n line2 \t\n line3 \t\n\n/)
36
- logs = stringIO.string
35
+ if !(string_io.string =~ /INFO, [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} \+[0-9]{2}:[0-9]{2}, logger3, test multiline message \n line1 \n line2 \t\n line3 \t\n\n/)
36
+ logs = string_io.string
37
37
  assert(false, "wrong log message format: #{logs}")
38
38
  end
39
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exologger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vishnu Gajendran