src/database/system_logging.rb
# adds a log entry
# [msg] log message to add
# [source_id] optional. source object id reference to objects column family
# [target_id] optional. target object id reference to objects column family
# [object_id] optional. object object id reference to objects column family
# object_id is used in the case of log messages like this: "Foo gave the sword to Bar"
# where "Foo" is source_id, "Bar" is target_id, and "sword" is object_id
adds a log entry
[msg] log message to add
[source_id] optional. source object id reference to objects column family
[target_id] optional. target object id reference to objects column family
[object_id] optional.
adds a log entry [ msg ] log message to add [ source_id ] optional . source object id reference to objects column family [ target_id ] optional . target object id reference to objects column family [ object_id ] optional .
def add_log_entry(msg, source_id = nil, target_id = nil, object_id = nil)
    log_debug "adding log entry:#{msg}, source:#{source_id}, target:#{target_id}, object:#{object_id}"
    row_id = UUID.new
    log_row = {}
    log_row['log_id'] = row_id.to_guid.to_s
    log_row['source_id'] = source_id unless source_id.nil?
    log_row['target_id'] = target_id unless target_id.nil?
    log_row['object_id'] = object_id unless object_id.nil?
    log_row['msg'] = msg
    row_hash = {row_id => log_row}
    CassandraDao.insert :log, 'all',  row_hash
    CassandraDao.insert :log, source_id, row_hash unless source_id.nil?
    CassandraDao.insert :log, target_id, row_hash unless target_id.nil?
    CassandraDao.insert :log, object_id, row_hash unless object_id.nil?
    log_debug "add log id #{row_id.to_guid.to_s}"
    row_id    
  end
def add_log_entry ( msg , source_id = nil , target_id = nil , object_id = nil ) log_debug "adding log entry:#{msg}, source:#{source_id}, target:#{target_id}, object:#{object_id}" row_id = UUID . new log_row = { } log_row [ 'log_id' ] = row_id . to_guid . to_s log_row [ 'source_id' ] = source_id unless source_id . nil? log_row [ 'target_id' ] = target_id unless target_id . nil? log_row [ 'object_id' ] = object_id unless object_id . nil? log_row [ 'msg' ] = msg row_hash = { row_id => log_row } CassandraDao . insert :log , 'all' , row_hash CassandraDao . insert :log , source_id , row_hash unless source_id . nil? CassandraDao . insert :log , target_id , row_hash unless target_id . nil? CassandraDao . insert :log , object_id , row_hash unless object_id . nil? log_debug "add log id #{row_id.to_guid.to_s}" row_id end
adds a log entry
[msg] log message to add
[source_id] optional.
adds a log entry [ msg ] log message to add [ source_id ] optional .
# return the log id
msg
<not_specific>
source_id
<not_specific>
target_id
<not_specific>
object_id
<not_specific>