Class: Orchestra::Logger Deprecated
- Inherits:
-
Object
- Object
- Orchestra::Logger
- Includes:
- Singleton
- Defined in:
- lib/orchestra/logger.rb
Overview
Deprecated.
in favor of Ruby’s Logger
Constant Summary collapse
- LOG_FILE_PATH =
"/var/log/orchestra.log"
- TIMESTAMP_FORMAT =
"%Y%m%dT%H%M%SZ"
Instance Method Summary collapse
- #close_log_file ⇒ Object
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
- #log(text) ⇒ Object
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
10 11 12 |
# File 'lib/orchestra/logger.rb', line 10 def initialize @log_file = File.open(LOG_FILE_PATH, "a") end |
Instance Method Details
#close_log_file ⇒ Object
26 27 28 |
# File 'lib/orchestra/logger.rb', line 26 def close_log_file @log_file.close end |
#log(text) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/orchestra/logger.rb', line 14 def log(text) = Time.now.strftime(TIMESTAMP_FORMAT) = "#{} #{text}" # Append to the log file @log_file.puts() @log_file.flush # Print to stdout puts end |