Module: SOULs::SOULsLogger
- Defined in:
- lib/souls/app/utils/souls_logger.rb
Defined Under Namespace
Classes: Configuration
Class Attribute Summary collapse
Class Method Summary collapse
- .configure {|configuration| ... } ⇒ Object
- .critical_log(message) ⇒ Object
- .info_log(message) ⇒ Object
- .warning_log(message) ⇒ Object
- .write_log(message) ⇒ Object
Class Attribute Details
.configuration ⇒ Object
15 16 17 |
# File 'lib/souls/app/utils/souls_logger.rb', line 15 def self.configuration @configuration ||= Configuration.new end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
19 20 21 |
# File 'lib/souls/app/utils/souls_logger.rb', line 19 def self.configure yield(configuration) end |
.critical_log(message) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/souls/app/utils/souls_logger.rb', line 23 def self.critical_log() entry = write_log() entry.critical! configuration.logger.write_entries(entry) end |
.info_log(message) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/souls/app/utils/souls_logger.rb', line 37 def self.info_log() entry = write_log() entry.info! configuration.logger.write_entries(entry) end |
.warning_log(message) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/souls/app/utils/souls_logger.rb', line 30 def self.warning_log() entry = write_log() entry.warning! configuration.logger.write_entries(entry) end |
.write_log(message) ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/souls/app/utils/souls_logger.rb', line 44 def self.write_log() entry = configuration.logger.entry entry.payload = .backtrace.nil? ? "#{message}\n" : "#{message}\n #{message.backtrace.join("\n")}" entry.log_name = "error" entry.resource.type = "cloud_run_revision" entry.resource.labels[:service_name] = "souls" entry.resource.labels[:revision_name] = SOULs::VERSION entry end |