Don't include recorded_at with broadcast line
Receiving end will already add that
This commit is contained in:
@@ -4,7 +4,7 @@ class Mrsk::Commands::Auditor < Mrsk::Commands::Base
|
||||
# Runs remotely
|
||||
def record(line)
|
||||
append \
|
||||
[ :echo, tagged_line(line) ],
|
||||
[ :echo, tagged_record_line(line) ],
|
||||
audit_log_file
|
||||
end
|
||||
|
||||
@@ -12,7 +12,7 @@ class Mrsk::Commands::Auditor < Mrsk::Commands::Base
|
||||
def broadcast(line)
|
||||
if broadcast_cmd = config.audit_broadcast_cmd
|
||||
pipe \
|
||||
[ :echo, tagged_line(line) ],
|
||||
[ :echo, tagged_broadcast_line(line) ],
|
||||
broadcast_cmd
|
||||
end
|
||||
end
|
||||
@@ -26,19 +26,19 @@ class Mrsk::Commands::Auditor < Mrsk::Commands::Base
|
||||
"mrsk-#{config.service}-audit.log"
|
||||
end
|
||||
|
||||
def tagged_line(line)
|
||||
"'#{tags} #{line}'"
|
||||
def tagged_record_line(line)
|
||||
"'#{recorded_at_tag} #{performer_tag} #{line}'"
|
||||
end
|
||||
|
||||
def tags
|
||||
"[#{recorded_at}] [#{performer}]"
|
||||
def tagged_broadcast_line(line)
|
||||
"'#{performer_tag} #{line}'"
|
||||
end
|
||||
|
||||
def performer
|
||||
@performer ||= `whoami`.strip
|
||||
def performer_tag
|
||||
"[#{`whoami`.strip}]"
|
||||
end
|
||||
|
||||
def recorded_at
|
||||
Time.now.to_fs(:db)
|
||||
def recorded_at_tag
|
||||
"[#{Time.now.to_fs(:db)}]"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user