Class: Scribbler::Logger
- Inherits:
-
Object
- Object
- Scribbler::Logger
- Defined in:
- lib/scribbler/logger.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(location, options = {}) ⇒ Logger
constructor
A new instance of Logger.
-
#log ⇒ Object
Public: Save ourselves some repetition.
Constructor Details
#initialize(location, options = {}) ⇒ Logger
Returns a new instance of Logger.
13 14 15 16 |
# File 'lib/scribbler/logger.rb', line 13 def initialize(location, = {}) self.location = location self. = end |
Class Method Details
.log(location, options = {}) ⇒ Object
9 10 11 |
# File 'lib/scribbler/logger.rb', line 9 def self.log(location, = {}) new(location, ).log end |
Instance Method Details
#log ⇒ Object
Public: Save ourselves some repetition. Notifies error to NewRelic and drops given string into a given log.
location - Either a pathname from the above method or symbol for an above
method
options - Hash of options for logging on Ngin
:error - Error object, mostly for passing to NewRelic
:message - Message to log in the actual file
:custom_fields - Custom fields dropped into the default template
:template - Whether or not to use the template at this log
:new_relic - Notify NewRelic of the error (default: true)
Examples
log(Ngin.subseason_log_location, :error => e, :message => "Error message stuff", :new_relic => false)
log(:subseason, :error => e, :message => "Error message stuff")
log(:subseason, :message => "Logging like a bauss")
Returns Nothing.
39 40 41 42 |
# File 'lib/scribbler/logger.rb', line 39 def log notify_new_relic [:error], [:new_relic] apply_to_log end |