Module: RemoteLogger

Defined in:
lib/remote_logger.rb,
lib/version.rb,
lib/remote_logger/logger.rb,
lib/remote_logger/drb_logger.rb,
lib/remote_logger/ringy_logger.rb

Overview

TODO: Set up ACL, SSL and other security stuff

Defined Under Namespace

Classes: DrbLogger, Logger, RingyLogger

Constant Summary collapse

VERSION_FILE =

:nodoc:

Pathname.new(__FILE__).dirname + '../VERSION'
VERSION =
VERSION_FILE.exist? ? VERSION_FILE.read.strip : nil
DRB_URI =
'druby://127.0.0.1:61626'
LOGGER_NAME =
'RemoteLogger'
FILE_NAME =

Default service/logger name - used by Ring or retrieved via Log4R::Logger

'remote.log'
FILE_ENCODING =

File name of log file

'CP1251:UTF-8'
STDOUT_ENCODING =

Encoding pair of log file (‘File external:Ruby internal’)

'CP866:UTF-8'
PATTERN =

Encoding pair of stdout (‘Stdout external:Ruby internal’)

'%1.1l %d - %m'
DATE_PATTERN =

Log entry pattern

'%Y-%m-%d %H:%M:%S.%3N'

Class Method Summary collapse

Class Method Details

.require_libs(libs, opts = {}) ⇒ Object

Requires ruby source file(s). Accepts either single filename/glob or Array of filenames/globs. Accepts following options:

:file

Lib(s) required relative to this file - defaults to __FILE__

:dir

Required lib(s) located under this dir name - defaults to gem name



17
18
19
20
21
22
23
# File 'lib/remote_logger.rb', line 17

def self.require_libs( libs, opts={} )
  file = Pathname.new(opts[:file] || __FILE__)
  [libs].flatten.each do |lib|
    name = file.dirname + (opts[:dir] || file.basename('.*')) + lib.gsub(/(?<!.rb)$/, '.rb')
    Pathname.glob(name.to_s).sort.each {|rb| require rb}
  end
end