Module: StatsCloud::LoggerHelper
- Included in:
- StatsCloud, Client, ClusterClient, RegisterConnectionJob, SocketIOHelper, StatsmeterClient
- Defined in:
- lib/statscloud/helpers/logger_helper.rb
Overview
This helper works to help log errors and info about StatsCloud service work.
Instance Method Summary collapse
- #console_logger ⇒ Object
-
#log_error(error_message) ⇒ Object
Logs errors with 10 minutes interval.
-
#log_info(info_message) ⇒ Object
Logs information with 10 minutes interval.
-
#logger(output = default_output, files_to_keep = 10, size_to_age = 1_024_000) ⇒ Object
Log information about work to standard output.
Instance Method Details
#console_logger ⇒ Object
14 15 16 |
# File 'lib/statscloud/helpers/logger_helper.rb', line 14 def console_logger @console_logger ||= create_logger_instance(STDOUT) end |
#log_error(error_message) ⇒ Object
Logs errors with 10 minutes interval
26 27 28 29 30 |
# File 'lib/statscloud/helpers/logger_helper.rb', line 26 def log_error() logged = log_with_interval(error_type, last_error_log_at, ) update_last_error_at && log_stop_logging("errors") if logged false end |
#log_info(info_message) ⇒ Object
Logs information with 10 minutes interval
19 20 21 22 23 |
# File 'lib/statscloud/helpers/logger_helper.rb', line 19 def log_info() logged = log_with_interval(info_type, last_info_log_at, ) update_last_info_at && log_stop_logging("information") if logged true end |
#logger(output = default_output, files_to_keep = 10, size_to_age = 1_024_000) ⇒ Object
Log information about work to standard output
9 10 11 12 |
# File 'lib/statscloud/helpers/logger_helper.rb', line 9 def logger(output = default_output, files_to_keep = 10, size_to_age = 1_024_000) file_utils.mkdir_p "log" @logger ||= create_logger_instance(output, files_to_keep, size_to_age) end |