cogger 1.5.0 → 1.7.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +5 -2
- data/cogger.gemspec +2 -2
- data/lib/cogger/configuration.rb +8 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 20611cc2eeb6cbc938f208dd3076620f5dd99eba094502810c7092b2b686989a
|
|
4
|
+
data.tar.gz: af57a2397409845990a3ffa547e958b1d5a255c477851ec1e394f0434d043f8f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f9f99eb3d9954b42c1b05c10277afa2635c8632e295c0b884fe3da3923b0aa4ab418d9b7d9613ae01f55885e9b5bf00ae167315e1387fabb125cd96d4979a64
|
|
7
|
+
data.tar.gz: 1a68c6a90c4a6edd03c014f6a9469a2be0a2bc565912943e34664904c2204088b4ce379a691bafaf9d6a06528904f45f9ea373bb683d3948ed5c9b0c06e163cc
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/README.adoc
CHANGED
|
@@ -112,9 +112,10 @@ When creating a new logger, you can configure behavior via the following attribu
|
|
|
112
112
|
* `id`: The program/process ID which shows up in the logs as your `id`. Default: `$PROGRAM_NAME`. For example, if run within a `demo.rb` script, the `id` would be `"demo"`,
|
|
113
113
|
* `io`: The input/output stream. This can be `STDOUT/$stdout`, a file/path, or `nil`. Default: `$stdout`.
|
|
114
114
|
* `level`: The log level you want to log at. Can be `:debug`, `:info`, `:warn`, `:error`, `:fatal`, or `:unknown`. Default: `:info`.
|
|
115
|
-
* `formatter`: The formatter to use for formatting your log output. Default: `Cogger::Formatter::
|
|
115
|
+
* `formatter`: The formatter to use for formatting your log output. Default: `Cogger::Formatter::Emoji`. 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
|
|
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
|
+
spec.version = "1.7.0"
|
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
|
8
8
|
spec.homepage = "https://alchemists.io/projects/cogger"
|
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.signing_key = Gem.default_key_path
|
|
23
23
|
spec.cert_chain = [Gem.default_cert_path]
|
|
24
24
|
|
|
25
|
-
spec.required_ruby_version = "
|
|
25
|
+
spec.required_ruby_version = ">= 3.4"
|
|
26
26
|
spec.add_dependency "core", "~> 2.0"
|
|
27
27
|
spec.add_dependency "logger", "~> 1.7"
|
|
28
28
|
spec.add_dependency "refinements", "~> 13.5"
|
data/lib/cogger/configuration.rb
CHANGED
|
@@ -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.
|
|
4
|
+
version: 1.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brooke Kuhlmann
|
|
@@ -166,7 +166,7 @@ require_paths:
|
|
|
166
166
|
- lib
|
|
167
167
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
168
|
requirements:
|
|
169
|
-
- - "
|
|
169
|
+
- - ">="
|
|
170
170
|
- !ruby/object:Gem::Version
|
|
171
171
|
version: '3.4'
|
|
172
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
@@ -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.
|
|
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
|