pyer-logger 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/pyer/logger.rb +22 -26
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1fb8264eb6b552bd6372448e9a4892081592355
4
- data.tar.gz: 30cbb717001f157d12c927f06c9df5417c26f0b1
3
+ metadata.gz: a7439de8b230e777556ad8338f1f20eea207fcae
4
+ data.tar.gz: 26454618ccb4283a7d315cb08fa8d7f072e46bb7
5
5
  SHA512:
6
- metadata.gz: a795511e7737515fcf133e42981f5da3728e05c77ea32b40987a90516d2c5540cd75bb2be3c5a1756f3ec74c66ece4bf127b7f5d461337adb133d714b81ebf7c
7
- data.tar.gz: bfc035a8d4e80dfc68ca9dab9291c32c3c4bc755365448f57cc37bbb09decfdc9cdcc89665e176cc8e34592c2bc1675c040101d7df936eec2722fa85ec2abfd0
6
+ metadata.gz: dd2e3a78cb157f407df769b086f3b473301653766847272385986d6bc7847ec3f37c3a4d653b39b9a362926df0a481bc891f247da37f143055d5d92950bc76be
7
+ data.tar.gz: d64485503494cebc39af119faeb6cba7db1dad0ea343218c24825953f8cdec7de40a28c9498d36f9f8816c9f7cdd83011ed03993c471bdd85acd206699ee7f67
data/lib/pyer/logger.rb CHANGED
@@ -5,17 +5,16 @@
5
5
  #
6
6
  # The messages will have varying levels reflecting their varying importance.
7
7
  # The levels, and their meanings, are:
8
- # * ERROR : an error condition
9
- # * WARN : a warning
10
- # * INFO : generic (useful) information about system operation
11
- # * DEBUG : low-level information for developers
8
+ # 1. DEBUG : low-level information for developers
9
+ # 2. INFO : generic (useful) information about system operation
10
+ # 3. WARN : a warning
11
+ # 4. ERROR : an error condition
12
12
  #
13
13
  # So each message has a level, and the Logger itself has a level, which acts
14
14
  # as a filter, so you can control the amount of information emitted from the
15
15
  # logger without having to remove actual messages.
16
16
  #
17
- # How to create a logger ?
18
- # ------------------------
17
+ # == How to create a logger ?
19
18
  #
20
19
  # 1. Create a logger which logs messages to STDERR/STDOUT.
21
20
  # log = Logger.new(STDOUT, self.class)
@@ -29,51 +28,48 @@
29
28
  #
30
29
  # Notice that self.class argument prints the class name of the caller object.
31
30
  #
32
- # How to log a message ?
33
- # ----------------------
31
+ # == How to log a message ?
34
32
  #
35
33
  # Notice the different methods being used to log messages of various levels.
34
+ #
36
35
  # Messages lower than log.level are not sent to output.
37
- #
36
+ #
37
+ # Ranking: DEBUG < INFO < WARN < ERROR
38
+ #
38
39
  # Default log.level is DEBUG. That means all messages are emitted.
39
40
  #
40
- # DEBUG < INFO < WARN < ERROR
41
- #
42
- # 1. log.error "error is #{ @code }"
41
+ # 1. Debug message
42
+ # log.debug "dev info"
43
43
  #
44
- # 2. log.warn "a warning message"
44
+ # 2. Information
45
+ # log.info "some informations"
45
46
  #
46
- # 3. log.info "some informations"
47
+ # 3. Warning message
48
+ # log.warn "a warning message"
47
49
  #
48
- # 4. log.debug "dev info"
50
+ # 4. Error message
51
+ # log.error "error is #{ @code }"
49
52
  #
50
53
  # Messages are provided in a string or in a block, or both.
51
54
  #
52
55
  # 1. Message in block.
53
- #
54
56
  # log.error { "Argument 'foo' not given." }
55
57
  #
56
58
  # 2. Message as a string.
57
- #
58
59
  # log.error "Argument #{ @foo } mismatch."
59
60
  #
60
61
  # 3. Both arguments
61
- #
62
62
  # log.error("Argument ") { "#{ @foo } mismatch." }
63
63
  #
64
- # How to set severity level ?
65
- # ---------------------------
66
- #
64
+ # == How to set severity level ?
65
+ #
67
66
  # log.level = INFO
68
67
  #
69
- # How to close a logger ?
70
- # -----------------------
68
+ # == How to close a logger ?
71
69
  #
72
70
  # log.close
73
71
  #
74
- #
75
- # Installation
76
- # ------------
72
+ # == Installation
77
73
  #
78
74
  # gem install pyer-options
79
75
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pyer-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre BAZONNARD