cogger 1.5.0 → 1.6.0

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
  SHA256:
3
- metadata.gz: 492646c716b64bbf80f9aa93bf0092220068b00ef8abe89bc8baaaef9f3464f7
4
- data.tar.gz: 834d46200c376ffc6c538e229ae5f5ca4b44ba0beed3c2724e5585ebc8aca642
3
+ metadata.gz: 925679ac5f76d9dcd1d9dedde73857a6ca6f66b214321926d63b47a56b4eb857
4
+ data.tar.gz: db34b9122766c6f2b2f914435bd42c41a6b5b77a0b6be2b0352c0630f669c41f
5
5
  SHA512:
6
- metadata.gz: cc80eb9f305539d61932c5c5a95e01dfeb18ee76dee502049aabac4073ab37ee33ef45dbd73e7df6637b23f5b4e623df0e144e01a64755c646513bfe3dd45e0c
7
- data.tar.gz: 7c52fdfd07d8e2595f2f02e28b9546c4b7d389a9b7ae3f32feb686d8719a07533581f5b5ea28c0a0ab2684e457d7a3a8cc6e8b49ebfa0831deb6dbb1ffda5d95
6
+ metadata.gz: f404fed5aa1db3c8c118586976895c55a231883cbac4a8f386795729a58574103585637440597ea21939ecf6fd32530b616205884aea9bbd50f9f45e6139eeff
7
+ data.tar.gz: 623939be083087672ed80f20bc8a7641793ec19ded0191bb54f8eb3b72f0a535eeebdc1ae17c5072800198a19b49aef626bfd901264dfff4824a07466be777f0
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -115,6 +115,7 @@ When creating a new logger, you can configure behavior via the following attribu
115
115
  * `formatter`: The formatter to use for formatting your log output. Default: `Cogger::Formatter::Color`. See the _Formatters_ section for more info.
116
116
  * `tags`: The global tags used for all log entries. _Must_ be an array of objects you wish to use for tagging purposes. Default: `[]`.
117
117
  * `datetime_format`: The global date/time format used for all `Time`, `Date`, and/or `DateTime` values in your log entries. Default: `%Y-%m-%dT%H:%M:%S.%L%:z`.
118
+ * `header`: Determines if your log files should start with a date/time header comment. Can be `true` or `false` and is identical to the `skip_header` functionality found in the {logger_link} class. Default: `true`. This is automatically disabled -- and can't be overwritten -- when using the JSON formatter since the JSON format doesn't support code comments.
118
119
  * `mode`: The binary mode which determines if your logs should be written in binary mode or not. Can be `true` or `false` and is identical to the `binmode` functionality found in the {logger_link} class. Default: `false`.
119
120
  * `age`: The rotation age of your log. This only applies when logging to a file. This is equivalent to the `shift_age` as found with the {logger_link} class. Default: `0`.
120
121
  * `size`: The rotation size of your log. This only applies when logging to a file. This is equivalent to the `shift_size` as found with the {logger_link} class. Default: `1,048,576` (i.e. 1 MB).
@@ -134,6 +135,7 @@ logger = Cogger.new id: :demo,
134
135
  formatter: :json,
135
136
  tags: %w[DEMO DB],
136
137
  datetime_format: "%Y-%m-%d",
138
+ header: false,
137
139
  mode: false,
138
140
  age: 5,
139
141
  size: 1_000,
@@ -1183,8 +1185,9 @@ logger.inspect
1183
1185
  # @formatter=Cogger::Formatters::Emoji,
1184
1186
  # @datetime_format=\"%Y-%m-%dT%H:%M:%S.%L%:z\",
1185
1187
  # @tags=[],
1188
+ # @header=true,
1186
1189
  # @mode=false,
1187
- # @age=0,
1190
+ # @age=,
1188
1191
  # @size=1048576,
1189
1192
  # @suffix=\"%Y-%m-%d\",
1190
1193
  # @entry=Cogger::Entry,
data/cogger.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "cogger"
5
- spec.version = "1.5.0"
5
+ spec.version = "1.6.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/cogger"
@@ -13,6 +13,7 @@ module Cogger
13
13
  :formatter,
14
14
  :datetime_format,
15
15
  :tags,
16
+ :header,
16
17
  :mode,
17
18
  :age,
18
19
  :size,
@@ -29,6 +30,7 @@ module Cogger
29
30
  formatter: Formatters::Emoji.new,
30
31
  datetime_format: DATETIME_FORMAT,
31
32
  tags: Core::EMPTY_ARRAY,
33
+ header: true,
32
34
  mode: false,
33
35
  age: nil,
34
36
  size: 1_048_576,
@@ -49,6 +51,7 @@ module Cogger
49
51
  level:,
50
52
  formatter:,
51
53
  datetime_format:,
54
+ skip_header: skip_header?,
52
55
  binmode: mode,
53
56
  shift_period_suffix: suffix
54
57
  end
@@ -56,8 +59,12 @@ module Cogger
56
59
  def inspect
57
60
  "#<#{self.class} @id=#{id}, @io=#{io.class}, @level=#{level}, " \
58
61
  "@formatter=#{formatter.class}, @datetime_format=#{datetime_format.inspect}, " \
59
- "@tags=#{tags.inspect}, @mode=#{mode}, @age=#{age}, @size=#{size}, " \
62
+ "@tags=#{tags.inspect}, @header=#{header}, @mode=#{mode}, @age=#{age}, @size=#{size}, " \
60
63
  "@suffix=#{suffix.inspect}, @entry=#{entry}, @logger=#{logger}>"
61
64
  end
65
+
66
+ private
67
+
68
+ def skip_header? = formatter == :json || formatter.is_a?(Formatters::JSON) || !header
62
69
  end
63
70
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0'
177
177
  requirements: []
178
- rubygems_version: 3.7.1
178
+ rubygems_version: 3.7.2
179
179
  specification_version: 4
180
180
  summary: A customizable and feature rich logger.
181
181
  test_files: []
metadata.gz.sig CHANGED
Binary file