|
@ -1,9 +1,12 @@ |
|
|
return if Rails.application.tailwind_watcher? |
|
|
return if Rails.application.tailwind_watcher? |
|
|
|
|
|
|
|
|
|
|
|
return unless Rails.application.server? |
|
|
|
|
|
|
|
|
|
|
|
if Rails.env.development? |
|
|
RailsSemanticLogger::Rack::Logger.logger.level = :info # useful for remaining log like "[Rack::Log] Started..." |
|
|
RailsSemanticLogger::Rack::Logger.logger.level = :info # useful for remaining log like "[Rack::Log] Started..." |
|
|
SemanticLogger.clear_appenders! |
|
|
SemanticLogger.clear_appenders! |
|
|
|
|
|
|
|
|
return unless Rails.application.server? |
|
|
|
|
|
|
|
|
Rails.logger.name = 'rails' |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
def build_instrumentation_config |
|
|
def build_instrumentation_config |
|
|
{ |
|
|
{ |
|
@ -16,8 +19,6 @@ def build_instrumentation_config |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
Rails.configuration.after_initialize do |
|
|
Rails.configuration.after_initialize do |
|
|
Rails.logger.name = 'rails' |
|
|
|
|
|
|
|
|
|
|
|
ActiveSupport::Notifications.subscribe('rolling.live_constant') do |event| |
|
|
ActiveSupport::Notifications.subscribe('rolling.live_constant') do |event| |
|
|
constants = event.payload[:changes].map { |change| change[:constant] } |
|
|
constants = event.payload[:changes].map { |change| change[:constant] } |
|
|
if constants.intersection(%w[ACTIVE_RECORD ACTION_VIEW]).any? |
|
|
if constants.intersection(%w[ACTIVE_RECORD ACTION_VIEW]).any? |
|
@ -28,7 +29,7 @@ end |
|
|
|
|
|
|
|
|
Rails.autoloaders.main.on_load('ApplicationController') do |
|
|
Rails.autoloaders.main.on_load('ApplicationController') do |
|
|
SemanticLogger.clear_appenders! |
|
|
SemanticLogger.clear_appenders! |
|
|
SemanticLogger.add_appender(io: $stdout, formatter: Semantic::FancyFormatter.new) |
|
|
|
|
|
|
|
|
SemanticLogger.add_appender(io: $stdout, formatter: Rails.application.config.x.semantic.formatter.constantize.new) |
|
|
|
|
|
|
|
|
Rails.logger.info ' ', dimensions: Semantic::FancyDimensions.new(rails: '╔═╗', before: 1) |
|
|
Rails.logger.info ' ', dimensions: Semantic::FancyDimensions.new(rails: '╔═╗', before: 1) |
|
|
Rails.logger.fatal 'Zeitwerk RELOAD!', dimensions: Semantic::FancyDimensions.new(rails: '╠█╣') |
|
|
Rails.logger.fatal 'Zeitwerk RELOAD!', dimensions: Semantic::FancyDimensions.new(rails: '╠█╣') |
|
|