lib/tanga_services/logger.rb in tanga_services-0.0.1 vs lib/tanga_services/logger.rb in tanga_services-0.0.2
- old
+ new
@@ -8,10 +8,11 @@
# TangaServices.logger.open('my_application_name')
# TangaServices.logger.info({message: "I'm interesting data"})
# TangaServices.logger.error({message: "i crashed"})
class Logger < Syslog::Logger
def self.application_name=(application_name)
- @logger ||= Syslog::Logger.new(application_name, Syslog::LOG_LOCAL7)
+ fail "application name already set" if @logger
+ @logger = Syslog::Logger.new(application_name, Syslog::LOG_LOCAL7)
end
def self.debug(hash)
log(:debug, hash)
end