Class: Util::Logger
- Inherits:
-
Object
- Object
- Util::Logger
- Defined in:
- lib/kuniri/util/logger.rb
Overview
Abstract class responsible for define the log strategy.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(pPath = "/tmp/kuniri.log") ⇒ Logger
constructor
Create/open the log file, and save the path.
-
#write_log(pMessage) ⇒ Object
Write log, based on the message and the path.
Constructor Details
#initialize(pPath = "/tmp/kuniri.log") ⇒ Logger
Create/open the log file, and save the path.
11 12 13 14 |
# File 'lib/kuniri/util/logger.rb', line 11 def initialize(pPath = "/tmp/kuniri.log") File.open(pPath, 'a') @log_path = pPath end |
Instance Method Details
#write_log(pMessage) ⇒ Object
Write log, based on the message and the path. The most important thing about this method, is related with the implementation in different formats. Ex.: write_log can be implemented as HTML, txt, XML, etc.
22 23 24 |
# File 'lib/kuniri/util/logger.rb', line 22 def write_log(pMessage) raise NotImplementedError end |