Extract method

This commit is contained in:
David Heinemeier Hansson
2023-02-03 20:53:33 +01:00
parent 5911914e95
commit 94b28a1b29

View File

@@ -4,7 +4,7 @@ require "mrsk/commands/base"
class Mrsk::Commands::Auditor < Mrsk::Commands::Base
def record(line)
append \
[ :echo, "'#{tags} #{line}'" ],
[ :echo, tagged_line(line) ],
audit_log_file
end
@@ -17,6 +17,10 @@ class Mrsk::Commands::Auditor < Mrsk::Commands::Base
"mrsk-#{config.service}-audit.log"
end
def tagged_line(line)
"'#{tags} #{line}'"
end
def tags
"[#{timestamp}] [#{performer}]"
end