logstruct 0.3.0 → 0.4.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
- data/CHANGELOG.md +14 -0
- data/lib/log_struct/concerns/configuration.rb +2 -2
- data/lib/log_struct/config_struct/filters.rb +2 -5
- data/lib/log_struct/enums/level.rb +1 -1
- data/lib/log_struct/integrations/action_mailer/event_logging.rb +1 -0
- data/lib/log_struct/integrations/action_mailer/metadata_collection.rb +1 -0
- data/lib/log_struct/integrations/active_record.rb +1 -1
- data/lib/log_struct/integrations/ahoy.rb +1 -1
- data/lib/log_struct/integrations/carrierwave.rb +1 -0
- data/lib/log_struct/integrations/dotenv.rb +2 -1
- data/lib/log_struct/integrations/good_job.rb +2 -1
- data/lib/log_struct/integrations/host_authorization.rb +3 -6
- data/lib/log_struct/integrations/lograge.rb +19 -22
- data/lib/log_struct/integrations/puma.rb +1 -1
- data/lib/log_struct/integrations/rack_error_handler/error_lines.rb +1 -4
- data/lib/log_struct/integrations/shrine.rb +1 -1
- data/lib/log_struct/log/action_mailer/delivered.rb +9 -7
- data/lib/log_struct/log/action_mailer/delivery.rb +9 -7
- data/lib/log_struct/log/action_mailer/error.rb +9 -7
- data/lib/log_struct/log/action_mailer.rb +1 -0
- data/lib/log_struct/log/active_job/discard.rb +7 -5
- data/lib/log_struct/log/active_job/enqueue.rb +7 -5
- data/lib/log_struct/log/active_job/error.rb +7 -5
- data/lib/log_struct/log/active_job/finish.rb +7 -5
- data/lib/log_struct/log/active_job/retry.rb +7 -5
- data/lib/log_struct/log/active_job/retry_stopped.rb +7 -5
- data/lib/log_struct/log/active_job/schedule.rb +7 -5
- data/lib/log_struct/log/active_job/start.rb +7 -5
- data/lib/log_struct/log/active_job.rb +1 -0
- data/lib/log_struct/log/active_model_serializers.rb +7 -5
- data/lib/log_struct/log/active_storage/delete.rb +7 -5
- data/lib/log_struct/log/active_storage/download.rb +7 -5
- data/lib/log_struct/log/active_storage/exist.rb +7 -5
- data/lib/log_struct/log/active_storage/metadata.rb +7 -5
- data/lib/log_struct/log/active_storage/upload.rb +7 -5
- data/lib/log_struct/log/active_storage/url.rb +7 -5
- data/lib/log_struct/log/active_storage.rb +1 -0
- data/lib/log_struct/log/ahoy.rb +7 -5
- data/lib/log_struct/log/carrierwave/delete.rb +7 -5
- data/lib/log_struct/log/carrierwave/download.rb +7 -5
- data/lib/log_struct/log/carrierwave/upload.rb +7 -5
- data/lib/log_struct/log/carrierwave.rb +1 -0
- data/lib/log_struct/log/dotenv/load.rb +7 -5
- data/lib/log_struct/log/dotenv/restore.rb +7 -5
- data/lib/log_struct/log/dotenv/save.rb +7 -5
- data/lib/log_struct/log/dotenv/update.rb +7 -5
- data/lib/log_struct/log/error.rb +15 -15
- data/lib/log_struct/log/good_job/error.rb +7 -5
- data/lib/log_struct/log/good_job/log.rb +7 -5
- data/lib/log_struct/log/good_job.rb +1 -0
- data/lib/log_struct/log/plain.rb +9 -7
- data/lib/log_struct/log/puma/error.rb +9 -7
- data/lib/log_struct/log/puma/shutdown.rb +9 -7
- data/lib/log_struct/log/puma/start.rb +9 -7
- data/lib/log_struct/log/request.rb +15 -15
- data/lib/log_struct/log/security/blocked_host.rb +15 -15
- data/lib/log_struct/log/security/csrf_violation.rb +15 -15
- data/lib/log_struct/log/security/ip_spoof.rb +15 -15
- data/lib/log_struct/log/security.rb +1 -0
- data/lib/log_struct/log/shrine/delete.rb +7 -5
- data/lib/log_struct/log/shrine/download.rb +7 -5
- data/lib/log_struct/log/shrine/exist.rb +7 -5
- data/lib/log_struct/log/shrine/metadata.rb +7 -5
- data/lib/log_struct/log/shrine/upload.rb +7 -5
- data/lib/log_struct/log/sidekiq/error.rb +9 -7
- data/lib/log_struct/log/sidekiq/log.rb +9 -7
- data/lib/log_struct/log/sql.rb +9 -7
- data/lib/log_struct/monkey_patches/active_support/tagged_logging/formatter.rb +1 -0
- data/lib/log_struct/multi_error_reporter.rb +1 -1
- data/lib/log_struct/params_errors.rb +7 -10
- data/lib/log_struct/rails_boot_banner_silencer.rb +1 -0
- data/lib/log_struct/semantic_logger/concerns/log_methods.rb +1 -0
- data/lib/log_struct/semantic_logger/formatter.rb +1 -1
- data/lib/log_struct/semantic_logger/logger.rb +1 -1
- data/lib/log_struct/semantic_logger/setup.rb +1 -4
- data/lib/log_struct/string_scrubber.rb +1 -1
- data/lib/log_struct/version.rb +1 -1
- data/logstruct.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b257a68c1c28d1475a75a22d5114ad27325c6da9c327edb4eba4a035a2ec3de0
|
|
4
|
+
data.tar.gz: f32b4ea82a198a0a7bae0b6454411ddd28ddf92ae09d96948d02074399cc242c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53ded423b2a206e38da2799efa3a5a8687a68acc86da9270548bd1e08e722cf2862604733f413e71e88d9d8d54ae637e1b7316b893fd1ee4a81e0e0f42fd8efc
|
|
7
|
+
data.tar.gz: 5fde1dfdb59100833384f59126d64b0cd5466abcc4304278f1312c3bca2fad6f0461b16f47720c142600c6f8e059faf27f032b235d9c34e400fc08738fb29382
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.0] - 2026-11-06
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- **Breaking**: Requires `sorbet-runtime` 0.6.12698 or later, the first version with `T::Module`, which `LogStruct::SemanticLogger::Logger`'s signature uses.
|
|
15
|
+
- **Breaking**: Log structs mark the props that implement their interfaces with `override: true`, which current versions of Sorbet require. A custom log struct needs the same on its `level`, `timestamp` and `additional_data` props, with the interfaces included above them.
|
|
16
|
+
- **Development**: Update the locked gems and the docs and tooling packages, including Sorbet 0.6, Tapioca 0.20 and RuboCop 1.91. CI tests Rails 7.2.4, 8.0.5.2 and 8.1.4.1.
|
|
17
|
+
- **Development**: `task ci` runs `jscpd`. GitHub CI runs the dependency audits, and a release waits for them.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- **Development**: Update the locked `crass` dependency to 1.0.8, which fixes GHSA-pq4g-8rxf-4g29, and move `glob` and `minimatch` in the development tools to patched versions.
|
|
22
|
+
- **Generation**: An interrupted run leaves the generated files as they were, because they're written to a staging directory and moved into place.
|
|
23
|
+
|
|
10
24
|
## [0.3.0] - 2026-10-23
|
|
11
25
|
|
|
12
26
|
### Changed
|
|
@@ -12,7 +12,7 @@ module LogStruct
|
|
|
12
12
|
module ClassMethods
|
|
13
13
|
extend T::Sig
|
|
14
14
|
|
|
15
|
-
CONSOLE_COMMAND_ARGS =
|
|
15
|
+
CONSOLE_COMMAND_ARGS = ["console", "c"].freeze
|
|
16
16
|
EMPTY_ARGV = T.let([].freeze, T::Array[String])
|
|
17
17
|
RAILS_PATTERNS_LABEL = "Rails filter_parameters"
|
|
18
18
|
RAILS_REGEXPS_LABEL = "Rails filter_parameters (Regexps)"
|
|
@@ -237,7 +237,7 @@ module LogStruct
|
|
|
237
237
|
# there or from the field's value down, as it would in Rails.
|
|
238
238
|
sig { params(patterns: T::Array[T.untyped]).returns(ConfigStruct::PathFilterMatcher) }
|
|
239
239
|
def build_rails_path_matcher(patterns)
|
|
240
|
-
regexps = patterns.
|
|
240
|
+
regexps = patterns.grep(Regexp)
|
|
241
241
|
strings = patterns.reject { |entry| entry.is_a?(Regexp) }.map { |entry| Regexp.escape(entry.to_s) }
|
|
242
242
|
regexps << Regexp.new(strings.join("|"), true) if strings.any?
|
|
243
243
|
callable = Kernel.lambda do |path, _value, _root|
|
|
@@ -62,7 +62,7 @@ module LogStruct
|
|
|
62
62
|
class LazyRoot
|
|
63
63
|
extend T::Sig
|
|
64
64
|
|
|
65
|
-
UNAVAILABLE =
|
|
65
|
+
UNAVAILABLE = Object.new.freeze
|
|
66
66
|
|
|
67
67
|
sig { params(value: T.untyped).void }
|
|
68
68
|
def initialize(value)
|
|
@@ -187,10 +187,7 @@ module LogStruct
|
|
|
187
187
|
# - api_key, secret_key, private_key, access_key, encryption_key, signing_key, master_key: X-Api-Key
|
|
188
188
|
# - signature, sig, salt and certificate as the last word: X-Amz-Signature (but not signature_field_id)
|
|
189
189
|
# Matching whole words avoids false positives like "keyboard", "author" or "cron_key".
|
|
190
|
-
DEFAULT_SENSITIVE_KEY_PATTERN =
|
|
191
|
-
/(?:\A|_)(?:passwords?|passwd|passphrases?|passcodes?|pwd|tokens?|secrets?|auth|authorization|authentication|creds?|credentials?|cookies?|sessions?|jwts?|bearer|otps?|apikeys?|cvv|cvc|ssn|social_security(?:_numbers?)?|credit_cards?|card_numbers?|crypt|crypted)(?:_|\z)|(?:\A|_)(?:api|secret|private|access|encryption|signing|master)_keys?(?:_|\z)|(?:\A|_)(?:signature|sig|salt|certificate)s?\z/,
|
|
192
|
-
Regexp
|
|
193
|
-
)
|
|
190
|
+
DEFAULT_SENSITIVE_KEY_PATTERN = /(?:\A|_)(?:passwords?|passwd|passphrases?|passcodes?|pwd|tokens?|secrets?|auth|authorization|authentication|creds?|credentials?|cookies?|sessions?|jwts?|bearer|otps?|apikeys?|cvv|cvc|ssn|social_security(?:_numbers?)?|credit_cards?|card_numbers?|crypt|crypted)(?:_|\z)|(?:\A|_)(?:api|secret|private|access|encryption|signing|master)_keys?(?:_|\z)|(?:\A|_)(?:signature|sig|salt|certificate)s?\z/
|
|
194
191
|
|
|
195
192
|
# Matchers for keys that aren't listed by name in filter_keys. Each matcher receives the key (String)
|
|
196
193
|
# and optional value, returning true when the pair should be filtered. Includes a regex matcher for
|
|
@@ -32,7 +32,7 @@ module LogStruct
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Convert a string or integer severity to a Level
|
|
35
|
-
sig { params(severity: T.any(String, Symbol, Integer
|
|
35
|
+
sig { params(severity: T.nilable(T.any(String, Symbol, Integer))).returns(Level) }
|
|
36
36
|
def self.from_severity(severity)
|
|
37
37
|
return Unknown if severity.nil?
|
|
38
38
|
return from_severity_int(severity) if severity.is_a?(Integer)
|
|
@@ -7,6 +7,7 @@ module LogStruct
|
|
|
7
7
|
# Handles collection of metadata for email logging
|
|
8
8
|
module MetadataCollection
|
|
9
9
|
extend T::Sig
|
|
10
|
+
|
|
10
11
|
# Add message-specific metadata to log data
|
|
11
12
|
sig { params(mailer: T.untyped, log_data: T::Hash[Symbol, T.untyped]).void }
|
|
12
13
|
def self.add_message_metadata(mailer, log_data)
|
|
@@ -43,7 +43,7 @@ module LogStruct
|
|
|
43
43
|
|
|
44
44
|
# Track subscription state keyed to the current Notifications.notifier instance
|
|
45
45
|
State = ::Struct.new(:subscribed, :notifier_id)
|
|
46
|
-
STATE =
|
|
46
|
+
STATE = State.new(false, nil)
|
|
47
47
|
|
|
48
48
|
# Set up SQL query logging integration
|
|
49
49
|
sig { override.params(config: LogStruct::Configuration).returns(T.nilable(T::Boolean)) }
|
|
@@ -20,7 +20,7 @@ module LogStruct
|
|
|
20
20
|
|
|
21
21
|
# Takes whatever Ahoy's track takes and passes it on as given, so Ahoy's defaults still apply
|
|
22
22
|
sig { params(name: T.untyped, args: T.untyped).returns(T.untyped) }
|
|
23
|
-
def track(name, *args)
|
|
23
|
+
def track(name, *args) # rubocop:disable Sorbet/BlockMethodDefinition -- it's prepended and calls implicit super, which define_method can't do
|
|
24
24
|
result = super
|
|
25
25
|
begin
|
|
26
26
|
LogStruct.info(
|
|
@@ -17,11 +17,12 @@ module LogStruct
|
|
|
17
17
|
module Dotenv
|
|
18
18
|
extend T::Sig
|
|
19
19
|
extend IntegrationInterface
|
|
20
|
+
|
|
20
21
|
@original_logger_setter = T.let(nil, T.nilable(UnboundMethod))
|
|
21
22
|
|
|
22
23
|
# Internal state holder to avoid duplicate subscriptions in a Sorbet-friendly way
|
|
23
24
|
State = ::Struct.new(:subscribed)
|
|
24
|
-
STATE =
|
|
25
|
+
STATE = State.new(false)
|
|
25
26
|
|
|
26
27
|
sig { override.params(config: LogStruct::Configuration).returns(T.nilable(T::Boolean)) }
|
|
27
28
|
def self.setup(config)
|
|
@@ -157,7 +157,8 @@ module LogStruct
|
|
|
157
157
|
return true unless defined?(::GoodJob::Notifier::CONNECTION_ERRORS)
|
|
158
158
|
|
|
159
159
|
::GoodJob::Notifier::CONNECTION_ERRORS.any? do |error_name|
|
|
160
|
-
|
|
160
|
+
# CONNECTION_ERRORS holds class names, because an app might not have loaded the database adapter they belong to
|
|
161
|
+
error_class = error_name.safe_constantize # rubocop:disable Sorbet/ConstantsFromStrings
|
|
161
162
|
error_class.is_a?(Class) && exception.is_a?(error_class)
|
|
162
163
|
end
|
|
163
164
|
end
|
|
@@ -12,14 +12,11 @@ module LogStruct
|
|
|
12
12
|
extend T::Sig
|
|
13
13
|
extend IntegrationInterface
|
|
14
14
|
|
|
15
|
-
RESPONSE_HTML =
|
|
16
|
-
"<html><head><title>Blocked Host</title></head><body>" \
|
|
15
|
+
RESPONSE_HTML = "<html><head><title>Blocked Host</title></head><body>" \
|
|
17
16
|
"<h1>Blocked Host</h1>" \
|
|
18
17
|
"<p>This host is not permitted to access this application.</p>" \
|
|
19
18
|
"<p>If you are the administrator, check your configuration.</p>" \
|
|
20
|
-
"</body></html>"
|
|
21
|
-
String
|
|
22
|
-
)
|
|
19
|
+
"</body></html>"
|
|
23
20
|
RESPONSE_HEADERS = T.let(
|
|
24
21
|
{
|
|
25
22
|
"Content-Type" => "text/html",
|
|
@@ -27,7 +24,7 @@ module LogStruct
|
|
|
27
24
|
}.freeze,
|
|
28
25
|
T::Hash[String, String]
|
|
29
26
|
)
|
|
30
|
-
FORBIDDEN_STATUS =
|
|
27
|
+
FORBIDDEN_STATUS = 403
|
|
31
28
|
|
|
32
29
|
# Set up host authorization logging
|
|
33
30
|
sig { override.params(config: LogStruct::Configuration).returns(T.nilable(T::Boolean)) }
|
|
@@ -14,28 +14,25 @@ module LogStruct
|
|
|
14
14
|
module Lograge
|
|
15
15
|
extend IntegrationInterface
|
|
16
16
|
|
|
17
|
-
LOGRAGE_KNOWN_KEYS =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
].freeze,
|
|
37
|
-
T::Array[Symbol]
|
|
38
|
-
)
|
|
17
|
+
LOGRAGE_KNOWN_KEYS = [
|
|
18
|
+
:method,
|
|
19
|
+
:path,
|
|
20
|
+
:format,
|
|
21
|
+
:controller,
|
|
22
|
+
:action,
|
|
23
|
+
:status,
|
|
24
|
+
:duration,
|
|
25
|
+
:view,
|
|
26
|
+
:db,
|
|
27
|
+
:params,
|
|
28
|
+
:request_id,
|
|
29
|
+
:source_ip,
|
|
30
|
+
:user_agent,
|
|
31
|
+
:referer,
|
|
32
|
+
:host,
|
|
33
|
+
:content_type,
|
|
34
|
+
:accept
|
|
35
|
+
].freeze
|
|
39
36
|
|
|
40
37
|
# With config.exceptions_app = routes, Rails renders an error page by sending the request through the app again
|
|
41
38
|
# as GET /<status>, and keeps the request's own method and path in these headers
|
|
@@ -196,7 +196,7 @@ module LogStruct
|
|
|
196
196
|
return true
|
|
197
197
|
end
|
|
198
198
|
|
|
199
|
-
if (m = l.match(/^(?:\*\s*)?Puma version: (\S+)(?:.*"([
|
|
199
|
+
if (m = l.match(/^(?:\*\s*)?Puma version: (\S+)(?:.*"([^"]+)")?/))
|
|
200
200
|
T.cast(STATE[:start_info], T::Hash[Symbol, T.untyped])[:puma_version] = m[1]
|
|
201
201
|
if m[2]
|
|
202
202
|
T.cast(STATE[:start_info], T::Hash[Symbol, T.untyped])[:puma_codename] = m[2]
|
|
@@ -12,10 +12,7 @@ module LogStruct
|
|
|
12
12
|
module ErrorLines
|
|
13
13
|
extend T::Sig
|
|
14
14
|
|
|
15
|
-
CSRF_ERROR_NAMES =
|
|
16
|
-
["ActionController::InvalidAuthenticityToken", "ActionController::InvalidCrossOriginRequest"].freeze,
|
|
17
|
-
T::Array[String]
|
|
18
|
-
)
|
|
15
|
+
CSRF_ERROR_NAMES = ["ActionController::InvalidAuthenticityToken", "ActionController::InvalidCrossOriginRequest"].freeze
|
|
19
16
|
|
|
20
17
|
sig { returns(T::Boolean) }
|
|
21
18
|
def self.enabled?
|
|
@@ -14,7 +14,7 @@ module LogStruct
|
|
|
14
14
|
extend T::Sig
|
|
15
15
|
extend IntegrationInterface
|
|
16
16
|
|
|
17
|
-
SHRINE_EVENTS =
|
|
17
|
+
SHRINE_EVENTS = %i[upload exists download delete metadata open].freeze
|
|
18
18
|
|
|
19
19
|
# The file name in a Content-Disposition (attachment; filename="..."; filename*=UTF-8''...). A quoted name
|
|
20
20
|
# can hold a semicolon, and whatever follows a quote (malformed or not) goes too.
|
|
@@ -23,11 +23,15 @@ module LogStruct
|
|
|
23
23
|
class Delivered < T::Struct
|
|
24
24
|
extend T::Sig
|
|
25
25
|
|
|
26
|
+
# A prop marked `override` needs the method it implements to exist already
|
|
27
|
+
include LogStruct::Log::Interfaces::CommonFields
|
|
28
|
+
include LogStruct::Log::Interfaces::AdditionalDataField
|
|
29
|
+
|
|
26
30
|
# Shared/common fields
|
|
27
|
-
const :source, Source::Mailer, default: Source::Mailer
|
|
28
|
-
const :event, Event, default: Event::Delivered
|
|
29
|
-
const :timestamp, Time, factory: -> { Time.now }
|
|
30
|
-
const :level, Level, default: Level::Info
|
|
31
|
+
const :source, Source::Mailer, default: Source::Mailer, override: true
|
|
32
|
+
const :event, Event, default: Event::Delivered, override: true
|
|
33
|
+
const :timestamp, Time, factory: -> { Time.now }, override: true
|
|
34
|
+
const :level, Level, default: Level::Info, override: true
|
|
31
35
|
|
|
32
36
|
const :to, T.nilable(T::Array[String]), default: nil
|
|
33
37
|
const :from, T.nilable(String), default: nil
|
|
@@ -38,8 +42,7 @@ module LogStruct
|
|
|
38
42
|
const :attachment_count, T.nilable(Integer), default: nil
|
|
39
43
|
|
|
40
44
|
# Additional data
|
|
41
|
-
|
|
42
|
-
const :additional_data, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), default: nil
|
|
45
|
+
const :additional_data, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), default: nil, override: true
|
|
43
46
|
include LogStruct::Log::Shared::MergeAdditionalDataFields
|
|
44
47
|
|
|
45
48
|
FIELD_KEYS = T.let(
|
|
@@ -53,7 +56,6 @@ module LogStruct
|
|
|
53
56
|
end
|
|
54
57
|
|
|
55
58
|
# Serialize shared fields
|
|
56
|
-
include LogStruct::Log::Interfaces::CommonFields
|
|
57
59
|
include LogStruct::Log::Shared::SerializeCommon
|
|
58
60
|
|
|
59
61
|
sig { returns(T::Hash[LogStruct::LogField, T.untyped]) }
|
|
@@ -23,11 +23,15 @@ module LogStruct
|
|
|
23
23
|
class Delivery < T::Struct
|
|
24
24
|
extend T::Sig
|
|
25
25
|
|
|
26
|
+
# A prop marked `override` needs the method it implements to exist already
|
|
27
|
+
include LogStruct::Log::Interfaces::CommonFields
|
|
28
|
+
include LogStruct::Log::Interfaces::AdditionalDataField
|
|
29
|
+
|
|
26
30
|
# Shared/common fields
|
|
27
|
-
const :source, Source::Mailer, default: Source::Mailer
|
|
28
|
-
const :event, Event, default: Event::Delivery
|
|
29
|
-
const :timestamp, Time, factory: -> { Time.now }
|
|
30
|
-
const :level, Level, default: Level::Info
|
|
31
|
+
const :source, Source::Mailer, default: Source::Mailer, override: true
|
|
32
|
+
const :event, Event, default: Event::Delivery, override: true
|
|
33
|
+
const :timestamp, Time, factory: -> { Time.now }, override: true
|
|
34
|
+
const :level, Level, default: Level::Info, override: true
|
|
31
35
|
|
|
32
36
|
const :to, T.nilable(T::Array[String]), default: nil
|
|
33
37
|
const :from, T.nilable(String), default: nil
|
|
@@ -38,8 +42,7 @@ module LogStruct
|
|
|
38
42
|
const :attachment_count, T.nilable(Integer), default: nil
|
|
39
43
|
|
|
40
44
|
# Additional data
|
|
41
|
-
|
|
42
|
-
const :additional_data, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), default: nil
|
|
45
|
+
const :additional_data, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), default: nil, override: true
|
|
43
46
|
include LogStruct::Log::Shared::MergeAdditionalDataFields
|
|
44
47
|
|
|
45
48
|
FIELD_KEYS = T.let(
|
|
@@ -53,7 +56,6 @@ module LogStruct
|
|
|
53
56
|
end
|
|
54
57
|
|
|
55
58
|
# Serialize shared fields
|
|
56
|
-
include LogStruct::Log::Interfaces::CommonFields
|
|
57
59
|
include LogStruct::Log::Shared::SerializeCommon
|
|
58
60
|
|
|
59
61
|
sig { returns(T::Hash[LogStruct::LogField, T.untyped]) }
|
|
@@ -23,11 +23,15 @@ module LogStruct
|
|
|
23
23
|
class Error < T::Struct
|
|
24
24
|
extend T::Sig
|
|
25
25
|
|
|
26
|
+
# A prop marked `override` needs the method it implements to exist already
|
|
27
|
+
include LogStruct::Log::Interfaces::CommonFields
|
|
28
|
+
include LogStruct::Log::Interfaces::AdditionalDataField
|
|
29
|
+
|
|
26
30
|
# Shared/common fields
|
|
27
|
-
const :source, Source::Mailer, default: Source::Mailer
|
|
28
|
-
const :event, Event, default: Event::Error
|
|
29
|
-
const :timestamp, Time, factory: -> { Time.now }
|
|
30
|
-
const :level, Level, default: Level::Info
|
|
31
|
+
const :source, Source::Mailer, default: Source::Mailer, override: true
|
|
32
|
+
const :event, Event, default: Event::Error, override: true
|
|
33
|
+
const :timestamp, Time, factory: -> { Time.now }, override: true
|
|
34
|
+
const :level, Level, default: Level::Info, override: true
|
|
31
35
|
|
|
32
36
|
const :to, T.nilable(T::Array[String]), default: nil
|
|
33
37
|
const :from, T.nilable(String), default: nil
|
|
@@ -43,8 +47,7 @@ module LogStruct
|
|
|
43
47
|
const :backtrace, T.nilable(T::Array[String]), default: nil
|
|
44
48
|
|
|
45
49
|
# Additional data
|
|
46
|
-
|
|
47
|
-
const :additional_data, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), default: nil
|
|
50
|
+
const :additional_data, T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), default: nil, override: true
|
|
48
51
|
include LogStruct::Log::Shared::MergeAdditionalDataFields
|
|
49
52
|
|
|
50
53
|
FIELD_KEYS = T.let(
|
|
@@ -58,7 +61,6 @@ module LogStruct
|
|
|
58
61
|
end
|
|
59
62
|
|
|
60
63
|
# Serialize shared fields
|
|
61
|
-
include LogStruct::Log::Interfaces::CommonFields
|
|
62
64
|
include LogStruct::Log::Shared::SerializeCommon
|
|
63
65
|
|
|
64
66
|
sig { returns(T::Hash[LogStruct::LogField, T.untyped]) }
|
|
@@ -23,11 +23,14 @@ module LogStruct
|
|
|
23
23
|
class Discard < T::Struct
|
|
24
24
|
extend T::Sig
|
|
25
25
|
|
|
26
|
+
# A prop marked `override` needs the method it implements to exist already
|
|
27
|
+
include LogStruct::Log::Interfaces::CommonFields
|
|
28
|
+
|
|
26
29
|
# Shared/common fields
|
|
27
|
-
const :source, Source::Job, default: Source::Job
|
|
28
|
-
const :event, Event, default: Event::Discard
|
|
29
|
-
const :timestamp, Time, factory: -> { Time.now }
|
|
30
|
-
const :level, Level, default: Level::Info
|
|
30
|
+
const :source, Source::Job, default: Source::Job, override: true
|
|
31
|
+
const :event, Event, default: Event::Discard, override: true
|
|
32
|
+
const :timestamp, Time, factory: -> { Time.now }, override: true
|
|
33
|
+
const :level, Level, default: Level::Info, override: true
|
|
31
34
|
|
|
32
35
|
const :job_id, String
|
|
33
36
|
const :job_class, String
|
|
@@ -41,7 +44,6 @@ module LogStruct
|
|
|
41
44
|
const :message, String
|
|
42
45
|
|
|
43
46
|
# Serialize shared fields
|
|
44
|
-
include LogStruct::Log::Interfaces::CommonFields
|
|
45
47
|
include LogStruct::Log::Shared::SerializeCommon
|
|
46
48
|
|
|
47
49
|
sig { returns(T::Hash[LogStruct::LogField, T.untyped]) }
|
|
@@ -23,11 +23,14 @@ module LogStruct
|
|
|
23
23
|
class Enqueue < T::Struct
|
|
24
24
|
extend T::Sig
|
|
25
25
|
|
|
26
|
+
# A prop marked `override` needs the method it implements to exist already
|
|
27
|
+
include LogStruct::Log::Interfaces::CommonFields
|
|
28
|
+
|
|
26
29
|
# Shared/common fields
|
|
27
|
-
const :source, Source::Job, default: Source::Job
|
|
28
|
-
const :event, Event, default: Event::Enqueue
|
|
29
|
-
const :timestamp, Time, factory: -> { Time.now }
|
|
30
|
-
const :level, Level, default: Level::Info
|
|
30
|
+
const :source, Source::Job, default: Source::Job, override: true
|
|
31
|
+
const :event, Event, default: Event::Enqueue, override: true
|
|
32
|
+
const :timestamp, Time, factory: -> { Time.now }, override: true
|
|
33
|
+
const :level, Level, default: Level::Info, override: true
|
|
31
34
|
|
|
32
35
|
const :job_id, String
|
|
33
36
|
const :job_class, String
|
|
@@ -37,7 +40,6 @@ module LogStruct
|
|
|
37
40
|
const :provider_job_id, T.nilable(String), default: nil
|
|
38
41
|
|
|
39
42
|
# Serialize shared fields
|
|
40
|
-
include LogStruct::Log::Interfaces::CommonFields
|
|
41
43
|
include LogStruct::Log::Shared::SerializeCommon
|
|
42
44
|
|
|
43
45
|
sig { returns(T::Hash[LogStruct::LogField, T.untyped]) }
|
|
@@ -23,11 +23,14 @@ module LogStruct
|
|
|
23
23
|
class Error < T::Struct
|
|
24
24
|
extend T::Sig
|
|
25
25
|
|
|
26
|
+
# A prop marked `override` needs the method it implements to exist already
|
|
27
|
+
include LogStruct::Log::Interfaces::CommonFields
|
|
28
|
+
|
|
26
29
|
# Shared/common fields
|
|
27
|
-
const :source, Source::Job, default: Source::Job
|
|
28
|
-
const :event, Event, default: Event::Error
|
|
29
|
-
const :timestamp, Time, factory: -> { Time.now }
|
|
30
|
-
const :level, Level, default: Level::Info
|
|
30
|
+
const :source, Source::Job, default: Source::Job, override: true
|
|
31
|
+
const :event, Event, default: Event::Error, override: true
|
|
32
|
+
const :timestamp, Time, factory: -> { Time.now }, override: true
|
|
33
|
+
const :level, Level, default: Level::Info, override: true
|
|
31
34
|
|
|
32
35
|
const :job_id, String
|
|
33
36
|
const :job_class, String
|
|
@@ -42,7 +45,6 @@ module LogStruct
|
|
|
42
45
|
const :backtrace, T.nilable(T::Array[String]), default: nil
|
|
43
46
|
|
|
44
47
|
# Serialize shared fields
|
|
45
|
-
include LogStruct::Log::Interfaces::CommonFields
|
|
46
48
|
include LogStruct::Log::Shared::SerializeCommon
|
|
47
49
|
|
|
48
50
|
sig { returns(T::Hash[LogStruct::LogField, T.untyped]) }
|
|
@@ -23,11 +23,14 @@ module LogStruct
|
|
|
23
23
|
class Finish < T::Struct
|
|
24
24
|
extend T::Sig
|
|
25
25
|
|
|
26
|
+
# A prop marked `override` needs the method it implements to exist already
|
|
27
|
+
include LogStruct::Log::Interfaces::CommonFields
|
|
28
|
+
|
|
26
29
|
# Shared/common fields
|
|
27
|
-
const :source, Source::Job, default: Source::Job
|
|
28
|
-
const :event, Event, default: Event::Finish
|
|
29
|
-
const :timestamp, Time, factory: -> { Time.now }
|
|
30
|
-
const :level, Level, default: Level::Info
|
|
30
|
+
const :source, Source::Job, default: Source::Job, override: true
|
|
31
|
+
const :event, Event, default: Event::Finish, override: true
|
|
32
|
+
const :timestamp, Time, factory: -> { Time.now }, override: true
|
|
33
|
+
const :level, Level, default: Level::Info, override: true
|
|
31
34
|
|
|
32
35
|
const :job_id, String
|
|
33
36
|
const :job_class, String
|
|
@@ -41,7 +44,6 @@ module LogStruct
|
|
|
41
44
|
const :finished_at, Time
|
|
42
45
|
|
|
43
46
|
# Serialize shared fields
|
|
44
|
-
include LogStruct::Log::Interfaces::CommonFields
|
|
45
47
|
include LogStruct::Log::Shared::SerializeCommon
|
|
46
48
|
|
|
47
49
|
sig { returns(T::Hash[LogStruct::LogField, T.untyped]) }
|
|
@@ -23,11 +23,14 @@ module LogStruct
|
|
|
23
23
|
class Retry < T::Struct
|
|
24
24
|
extend T::Sig
|
|
25
25
|
|
|
26
|
+
# A prop marked `override` needs the method it implements to exist already
|
|
27
|
+
include LogStruct::Log::Interfaces::CommonFields
|
|
28
|
+
|
|
26
29
|
# Shared/common fields
|
|
27
|
-
const :source, Source::Job, default: Source::Job
|
|
28
|
-
const :event, Event, default: Event::Retry
|
|
29
|
-
const :timestamp, Time, factory: -> { Time.now }
|
|
30
|
-
const :level, Level, default: Level::Info
|
|
30
|
+
const :source, Source::Job, default: Source::Job, override: true
|
|
31
|
+
const :event, Event, default: Event::Retry, override: true
|
|
32
|
+
const :timestamp, Time, factory: -> { Time.now }, override: true
|
|
33
|
+
const :level, Level, default: Level::Info, override: true
|
|
31
34
|
|
|
32
35
|
const :job_id, String
|
|
33
36
|
const :job_class, String
|
|
@@ -42,7 +45,6 @@ module LogStruct
|
|
|
42
45
|
const :wait_ms, T.nilable(Float), default: nil
|
|
43
46
|
|
|
44
47
|
# Serialize shared fields
|
|
45
|
-
include LogStruct::Log::Interfaces::CommonFields
|
|
46
48
|
include LogStruct::Log::Shared::SerializeCommon
|
|
47
49
|
|
|
48
50
|
sig { returns(T::Hash[LogStruct::LogField, T.untyped]) }
|
|
@@ -23,11 +23,14 @@ module LogStruct
|
|
|
23
23
|
class RetryStopped < T::Struct
|
|
24
24
|
extend T::Sig
|
|
25
25
|
|
|
26
|
+
# A prop marked `override` needs the method it implements to exist already
|
|
27
|
+
include LogStruct::Log::Interfaces::CommonFields
|
|
28
|
+
|
|
26
29
|
# Shared/common fields
|
|
27
|
-
const :source, Source::Job, default: Source::Job
|
|
28
|
-
const :event, Event, default: Event::RetryStopped
|
|
29
|
-
const :timestamp, Time, factory: -> { Time.now }
|
|
30
|
-
const :level, Level, default: Level::Info
|
|
30
|
+
const :source, Source::Job, default: Source::Job, override: true
|
|
31
|
+
const :event, Event, default: Event::RetryStopped, override: true
|
|
32
|
+
const :timestamp, Time, factory: -> { Time.now }, override: true
|
|
33
|
+
const :level, Level, default: Level::Info, override: true
|
|
31
34
|
|
|
32
35
|
const :job_id, String
|
|
33
36
|
const :job_class, String
|
|
@@ -41,7 +44,6 @@ module LogStruct
|
|
|
41
44
|
const :message, String
|
|
42
45
|
|
|
43
46
|
# Serialize shared fields
|
|
44
|
-
include LogStruct::Log::Interfaces::CommonFields
|
|
45
47
|
include LogStruct::Log::Shared::SerializeCommon
|
|
46
48
|
|
|
47
49
|
sig { returns(T::Hash[LogStruct::LogField, T.untyped]) }
|
|
@@ -23,11 +23,14 @@ module LogStruct
|
|
|
23
23
|
class Schedule < T::Struct
|
|
24
24
|
extend T::Sig
|
|
25
25
|
|
|
26
|
+
# A prop marked `override` needs the method it implements to exist already
|
|
27
|
+
include LogStruct::Log::Interfaces::CommonFields
|
|
28
|
+
|
|
26
29
|
# Shared/common fields
|
|
27
|
-
const :source, Source::Job, default: Source::Job
|
|
28
|
-
const :event, Event, default: Event::Schedule
|
|
29
|
-
const :timestamp, Time, factory: -> { Time.now }
|
|
30
|
-
const :level, Level, default: Level::Info
|
|
30
|
+
const :source, Source::Job, default: Source::Job, override: true
|
|
31
|
+
const :event, Event, default: Event::Schedule, override: true
|
|
32
|
+
const :timestamp, Time, factory: -> { Time.now }, override: true
|
|
33
|
+
const :level, Level, default: Level::Info, override: true
|
|
31
34
|
|
|
32
35
|
const :job_id, String
|
|
33
36
|
const :job_class, String
|
|
@@ -40,7 +43,6 @@ module LogStruct
|
|
|
40
43
|
const :scheduled_at, Time
|
|
41
44
|
|
|
42
45
|
# Serialize shared fields
|
|
43
|
-
include LogStruct::Log::Interfaces::CommonFields
|
|
44
46
|
include LogStruct::Log::Shared::SerializeCommon
|
|
45
47
|
|
|
46
48
|
sig { returns(T::Hash[LogStruct::LogField, T.untyped]) }
|
|
@@ -23,11 +23,14 @@ module LogStruct
|
|
|
23
23
|
class Start < T::Struct
|
|
24
24
|
extend T::Sig
|
|
25
25
|
|
|
26
|
+
# A prop marked `override` needs the method it implements to exist already
|
|
27
|
+
include LogStruct::Log::Interfaces::CommonFields
|
|
28
|
+
|
|
26
29
|
# Shared/common fields
|
|
27
|
-
const :source, Source::Job, default: Source::Job
|
|
28
|
-
const :event, Event, default: Event::Start
|
|
29
|
-
const :timestamp, Time, factory: -> { Time.now }
|
|
30
|
-
const :level, Level, default: Level::Info
|
|
30
|
+
const :source, Source::Job, default: Source::Job, override: true
|
|
31
|
+
const :event, Event, default: Event::Start, override: true
|
|
32
|
+
const :timestamp, Time, factory: -> { Time.now }, override: true
|
|
33
|
+
const :level, Level, default: Level::Info, override: true
|
|
31
34
|
|
|
32
35
|
const :job_id, String
|
|
33
36
|
const :job_class, String
|
|
@@ -41,7 +44,6 @@ module LogStruct
|
|
|
41
44
|
const :attempt, T.nilable(Integer), default: nil
|
|
42
45
|
|
|
43
46
|
# Serialize shared fields
|
|
44
|
-
include LogStruct::Log::Interfaces::CommonFields
|
|
45
47
|
include LogStruct::Log::Shared::SerializeCommon
|
|
46
48
|
|
|
47
49
|
sig { returns(T::Hash[LogStruct::LogField, T.untyped]) }
|