Sha256: 18c257af99f97d31853b6ad067caa5057022426897958ed45c3e56c1ef4ba36a
Contents?: true
Size: 952 Bytes
Versions: 11
Compression:
Stored size: 952 Bytes
Contents
require 'singleton' require_relative 'condition_utils' require 'teLogger' include TeLogger require 'fileutils' module Antrapol module ToolRack class Logger include Singleton include Antrapol::ToolRack::ConditionUtils attr_reader :glogger def initialize # boolean loggerDebug = ENV['TOOLRACK_DEBUG'] logFile = ENV['TOOLRACK_LOGFILE'] || File.join(Dir.home, 'antrapol_logs','toolrack.log') maxLogNo = ENV['TOOLRACK_MAX_LOGFILE'] || 10 logFileSize = ENV['TOOLRACK_MAX_LOGFILE_SIZE'] || 10*1024*1024 logFileDir = File.dirname(logFile) if not File.exist?(logFileDir) ::FileUtils.mkdir_p(logFileDir) end if not_empty?(loggerDebug) and (loggerDebug.downcase == 'true') @glogger = Tlogger.new(STDOUT) else @glogger = Tlogger.new(logFile,maxLogNo,logFileSize) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems