Sha256: c1c3997b2fce7afe2e0010ef77140d46832c6d2a4fc7b57ef93ba78f1869ea01
Contents?: true
Size: 897 Bytes
Versions: 14
Compression:
Stored size: 897 Bytes
Contents
require 'logger' module RubyApp require 'ruby_app/application' require 'ruby_app/mixins/delegate_mixin' class Log < ::Logger extend RubyApp::Mixins::DelegateMixin def exception(exception) self.error('-' * 80) self.error("exception=#{exception.class.inspect} #{exception.message}") self.error('-' * 80) self.error(exception.backtrace.join("\n")) self.error('-' * 80) end def self.get @@_log end def self.open! path = RubyApp::Application.options.log_path directory = File.dirname(path) Dir.mkdir(directory) unless File.exists?(directory) @@_log = RubyApp::Log.new(path) @@_log.debug("#{self}##{__method__} path=#{path.inspect}") end def self.close! @@_log.close if @@_log @@_log = nil end private def initialize(path) super(path) end end end
Version data entries
14 entries across 14 versions & 1 rubygems