Module: LogDb

Includes:
LogKernel
Defined in:
lib/logutils/db.rb,
lib/logutils/db.rb,
lib/logutils/server.rb,
lib/logutils/db/models.rb,
lib/logutils/db/schema.rb,
lib/logutils/db/deleter.rb

Defined Under Namespace

Modules: Models Classes: CreateDb, DbHandler, Deleter, Server

Constant Summary collapse

STDDBHANDLER =

default/standard db handler

DbHandler.new

Constants included from LogKernel

LogKernel::LEVEL_HASH, LogKernel::LEVEL_NAME, LogKernel::STDHANDLER, LogKernel::STDLOGGER, LogKernel::VERSION

Class Method Summary collapse

Methods included from LogKernel

root

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

class DbHandler



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?



67
68
69
70
# File 'lib/logutils/db.rb', line 67

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.handlers << STDDBHANDLER
end

.statsObject



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

def self.stats
  # to be done
end