-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed the duplication for defining the logger accessors everywhere …
…and instead created a logging helper which is included into Object.
- Loading branch information
Showing
7 changed files
with
43 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module Halcyon | ||
module Logging | ||
module Helpers | ||
|
||
def self.included(target) | ||
target.extend(ClassMethods) | ||
end | ||
|
||
# The current application logger instance. | ||
# | ||
# Examples | ||
# self.logger.debug "Deleting user's cached data" | ||
# | ||
# Returns Logger:logger | ||
def logger | ||
Halcyon.logger | ||
end | ||
|
||
module ClassMethods | ||
|
||
# The current application logger instance, usable in the class context. | ||
# This means you can call <tt>self.logger</tt> from inside of class | ||
# methods, filters, etc. | ||
# | ||
# Examples | ||
# self.logger.debug "Test message" | ||
# | ||
# Returns Logger:logger | ||
def logger | ||
Halcyon.logger | ||
end | ||
|
||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters