lib/prefab/internal_logger.rb in prefab-cloud-ruby-1.1.2 vs lib/prefab/internal_logger.rb in prefab-cloud-ruby-1.2.0

- old
+ new

@@ -1,30 +1,33 @@ # frozen_string_literal: true module Prefab class InternalLogger < ::Logger - def initialize(path, logger) - @path = path - @logger = logger + def initialize(path) + if path.is_a?(Class) + @path = path.name.split('::').last.downcase + else + @path = path + end end - def debug(progname = nil) - @logger.log_internal yield, @path, progname, DEBUG + def debug msg + Prefab::LoggerClient.instance.log_internal ::Logger::DEBUG, msg, @path end - def info(progname = nil) - @logger.log_internal yield, @path, progname, INFO + def info msg + Prefab::LoggerClient.instance.log_internal ::Logger::INFO, msg, @path end - def warn(progname = nil) - @logger.log_internal yield, @path, progname, WARN + def warn msg + Prefab::LoggerClient.instance.log_internal ::Logger::WARN, msg, @path end - def error(progname = nil) - @logger.log_internal yield, @path, progname, ERROR + def error msg + Prefab::LoggerClient.instance.log_internal ::Logger::ERROR, msg, @path end - def fatal(progname = nil) - @logger.log_internal yield, @path, progname, FATAL + def fatal msg + Prefab::LoggerClient.instance.log_internal ::Logger::FATAL, msg, @path end end end