solid_log-core 0.2.1 → 0.3.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: 57666e95b9a34b0195d26534e72bd914038f1a695e4de7b7d7f6f45b34378466
4
- data.tar.gz: b53d3cb3cf353a7346a71addaff504f3747348df7c1657d16900e43a8032b000
3
+ metadata.gz: fdaa6eddf534f079f16ed08414a7edf325a6d2fe1ba78e72641703d65b31e19a
4
+ data.tar.gz: 538b3124a09ae3ac84477ce42e746facdeae83ba275d90f26f05806cdba367e9
5
5
  SHA512:
6
- metadata.gz: ef71b13f98dad7c71afdd4af342e3c9fbb7c52e47160960f772f3726a74d530ca4b0e1ca1845143908303d4452c08077040f51c501dc0d5b6be99e34ced9751c
7
- data.tar.gz: 1991d2cb34051a8d2ea0ca99033a1cd6d6965d9840ee03d0e58755adc1c5e2171db6ddc2927cb90a52bdca0a86424ac13a61d26ef6cc8ff8b81c5701c586c41c
6
+ metadata.gz: 3149b7db46b6fa5c25e15fa40d4f5eb421b1baa09b33b21aa378b82ea3a60e1201cd8d67b16925fe460e068d6f0b330e6ba32a77dc82e40e1ab5692ff6d549f2
7
+ data.tar.gz: 595c139f179f3fa7990890110dc30343897d21789639487a44b80c3e8e7615dec016d88d41f79ae42ee61b3b1e7041ea2b28ffeee9bb751db7285d13c4a806b1
data/README.md CHANGED
@@ -4,7 +4,7 @@ Core models, database adapters, parser, DirectLogger, and HTTP client for the So
4
4
 
5
5
  ## Overview
6
6
 
7
- `solid_log-core` provides the shared foundation for `solid_log-service` and `solid_log-ui` gems:
7
+ `solid_log-core` provides the shared foundation for `solid_log-service` and `solid_log` gems:
8
8
 
9
9
  - **Models**: `RawEntry`, `Entry`, `Token`, `Field`, `FacetCache`
10
10
  - **Database Adapters**: SQLite, PostgreSQL, MySQL adapters with database-specific optimizations
@@ -38,7 +38,7 @@ gem 'mysql2', '>= 0.5' # For MySQL
38
38
 
39
39
  This gem is typically used as a dependency for:
40
40
  - **solid_log-service**: Standalone log ingestion service
41
- - **solid_log-ui**: Web interface for viewing logs
41
+ - **solid_log**: Main gem with core + web interface for viewing logs
42
42
 
43
43
  ### DirectLogger (Recommended for Parent App)
44
44
 
@@ -90,7 +90,7 @@ module SolidLog
90
90
  say "6. Create an API token:", :cyan
91
91
  say " rails solid_log:create_token[\"Production API\"]"
92
92
  say ""
93
- say "7. Mount the UI (if using solid_log-ui):", :cyan
93
+ say "7. Mount the UI (if using solid_log gem):", :cyan
94
94
  say " Add to config/routes.rb:"
95
95
  say " mount SolidLog::UI::Engine => '/admin/logs'"
96
96
  say ""
@@ -8,10 +8,10 @@ require "puma/plugin"
8
8
  # raw log entries and processes them using BatchParsingService.
9
9
  #
10
10
  # Usage in config/puma.rb:
11
- # plugin :solid_log if ENV["SOLIDLOG_PUMA_PLUGIN_ENABLED"]
11
+ # plugin :solid_log if ENV["SOLID_LOG_IN_PUMA"]
12
12
  #
13
13
  # Configuration:
14
- # SOLIDLOG_PUMA_PLUGIN_ENABLED=true
14
+ # SOLID_LOG_IN_PUMA=true
15
15
  # SOLIDLOG_INLINE_PARSING_ENABLED=true
16
16
  # SOLIDLOG_PARSE_INTERVAL=10
17
17
  # SOLIDLOG_PARSER_BATCH_SIZE=200
@@ -105,8 +105,8 @@ Puma::Plugin.create do
105
105
  # Check if plugin should be enabled
106
106
  def enabled?
107
107
  # Check ENV flag (explicit opt-in)
108
- return false if ENV["SOLIDLOG_PUMA_PLUGIN_ENABLED"] == "false"
109
- return false unless ENV["SOLIDLOG_PUMA_PLUGIN_ENABLED"]
108
+ return false if ENV["SOLID_LOG_IN_PUMA"] == "false"
109
+ return false unless ENV["SOLID_LOG_IN_PUMA"]
110
110
 
111
111
  # Check configuration flag
112
112
  return false unless config.inline_parsing_enabled
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidLog
4
+ module Core
5
+ module Jobs
6
+ # Conditionally inherit from ActiveJob if available
7
+ # This allows the same job class to work in Rails apps AND solid_log-service
8
+ if defined?(ActiveJob::Base)
9
+ BaseJob = ActiveJob::Base
10
+ else
11
+ # Plain Ruby class when ActiveJob not available
12
+ BaseJob = Class.new do
13
+ def self.queue_as(*_args)
14
+ # No-op when not using ActiveJob
15
+ end
16
+
17
+ def self.perform_later(*args, **kwargs)
18
+ # Synchronous execution when ActiveJob not available
19
+ new.perform(*args, **kwargs)
20
+ end
21
+
22
+ def self.perform_now(*args, **kwargs)
23
+ new.perform(*args, **kwargs)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -3,22 +3,6 @@
3
3
  module SolidLog
4
4
  module Core
5
5
  module Jobs
6
- # Conditionally inherit from ActiveJob if available
7
- if defined?(ActiveJob::Base)
8
- BaseJob = ActiveJob::Base
9
- else
10
- # Plain Ruby class when ActiveJob not available
11
- BaseJob = Class.new do
12
- def self.queue_as(*); end # No-op when not using ActiveJob
13
- def self.perform_later(*args, **kwargs)
14
- new.perform(*args, **kwargs)
15
- end
16
- def self.perform_now(*args, **kwargs)
17
- new.perform(*args, **kwargs)
18
- end
19
- end
20
- end
21
-
22
6
  class CacheCleanupJob < BaseJob
23
7
  queue_as :default
24
8
 
@@ -3,22 +3,6 @@
3
3
  module SolidLog
4
4
  module Core
5
5
  module Jobs
6
- # Conditionally inherit from ActiveJob if available
7
- if defined?(ActiveJob::Base)
8
- BaseJob = ActiveJob::Base
9
- else
10
- # Plain Ruby class when ActiveJob not available
11
- BaseJob = Class.new do
12
- def self.queue_as(*); end # No-op when not using ActiveJob
13
- def self.perform_later(*args, **kwargs)
14
- new.perform(*args, **kwargs)
15
- end
16
- def self.perform_now(*args, **kwargs)
17
- new.perform(*args, **kwargs)
18
- end
19
- end
20
- end
21
-
22
6
  class FieldAnalysisJob < BaseJob
23
7
  queue_as :default
24
8
 
@@ -3,28 +3,6 @@
3
3
  module SolidLog
4
4
  module Core
5
5
  module Jobs
6
- # Conditionally inherit from ActiveJob if available
7
- # This allows the same job class to work in Rails apps AND solid_log-service
8
- if defined?(ActiveJob::Base)
9
- BaseJob = ActiveJob::Base
10
- else
11
- # Plain Ruby class when ActiveJob not available
12
- BaseJob = Class.new do
13
- def self.queue_as(*_args)
14
- # No-op when not using ActiveJob
15
- end
16
-
17
- def self.perform_later(*args, **kwargs)
18
- # Synchronous execution when ActiveJob not available
19
- new.perform(*args, **kwargs)
20
- end
21
-
22
- def self.perform_now(*args, **kwargs)
23
- new.perform(*args, **kwargs)
24
- end
25
- end
26
- end
27
-
28
6
  # ParseJob processes batches of unparsed raw log entries.
29
7
  #
30
8
  # This job can be used in three contexts:
@@ -3,22 +3,6 @@
3
3
  module SolidLog
4
4
  module Core
5
5
  module Jobs
6
- # Conditionally inherit from ActiveJob if available
7
- if defined?(ActiveJob::Base)
8
- BaseJob = ActiveJob::Base
9
- else
10
- # Plain Ruby class when ActiveJob not available
11
- BaseJob = Class.new do
12
- def self.queue_as(*); end # No-op when not using ActiveJob
13
- def self.perform_later(*args, **kwargs)
14
- new.perform(*args, **kwargs)
15
- end
16
- def self.perform_now(*args, **kwargs)
17
- new.perform(*args, **kwargs)
18
- end
19
- end
20
- end
21
-
22
6
  class RetentionJob < BaseJob
23
7
  queue_as :default
24
8
 
@@ -1,5 +1,5 @@
1
1
  module SolidLog
2
2
  module Core
3
- VERSION = "0.2.1"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
@@ -31,6 +31,7 @@ require "solid_log/core/services/migration_runner"
31
31
  require "solid_log/core/services/batch_parsing_service"
32
32
 
33
33
  # Jobs
34
+ require "solid_log/core/jobs/base_job"
34
35
  require "solid_log/core/jobs/parse_job"
35
36
  require "solid_log/core/jobs/retention_job"
36
37
  require "solid_log/core/jobs/cache_cleanup_job"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid_log-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Loman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-16 00:00:00.000000000 Z
11
+ date: 2026-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -201,6 +201,7 @@ files:
201
201
  - lib/solid_log/core/client/lograge_formatter.rb
202
202
  - lib/solid_log/core/client/retry_handler.rb
203
203
  - lib/solid_log/core/configuration.rb
204
+ - lib/solid_log/core/jobs/base_job.rb
204
205
  - lib/solid_log/core/jobs/cache_cleanup_job.rb
205
206
  - lib/solid_log/core/jobs/field_analysis_job.rb
206
207
  - lib/solid_log/core/jobs/parse_job.rb