lib/tanga_services/logger.rb in tanga_services-0.0.2 vs lib/tanga_services/logger.rb in tanga_services-0.0.3
- old
+ new
@@ -8,11 +8,10 @@
# 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)
- fail "application name already set" if @logger
- @logger = Syslog::Logger.new(application_name, Syslog::LOG_LOCAL7)
+ @logger ||= Syslog::Logger.new(application_name, Syslog::LOG_LOCAL7)
end
def self.debug(hash)
log(:debug, hash)
end