Module: LogDb

Includes:
LogUtils::Kernel
Defined in:
lib/logutils/db.rb,
lib/logutils/db.rb,
lib/logutils/db/models.rb,
lib/logutils/db/schema.rb,
lib/logutils/db/deleter.rb

Defined Under Namespace

Modules: Models Classes: CreateDb, DbListener, Deleter

Constant Summary collapse

STDDBLISTENER =

class DbListener

DbListener.new

Constants included from LogUtils::Kernel

LogUtils::Kernel::STDLISTENER, LogUtils::Kernel::STDLOGGER, LogUtils::Kernel::VERSION

Class Method Summary collapse

Class Method Details



21
22
23
# File 'lib/logutils/db.rb', line 21

def self.banner
  "logdb #{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
end

.createObject

default/standard db listener



49
50
51
# File 'lib/logutils/db.rb', line 49

def self.create
  CreateDb.up
end

.delete!Object

delete ALL records (use with care!)



54
55
56
57
# File 'lib/logutils/db.rb', line 54

def self.delete!
  puts '*** deleting log table records/data...'
  Deleter.new.run
end

.setupObject

check: use different name? e.g. configure or connect ?? why or why not?



64
65
66
67
# File 'lib/logutils/db.rb', line 64

def self.setup   # check: use different name?  e.g. configure or connect ?? why or why not?
  # turn on logging to db  - assumes active connection
  STDLOGGER.listeners << STDDBLISTENER
end

.statsObject



60
61
62
# File 'lib/logutils/db.rb', line 60

def self.stats
  # to be done
end