Include a timestamp in every authentication logger message
This commit is contained in:
@@ -3,7 +3,9 @@ class AuthenticationLogger
|
|||||||
|
|
||||||
class << self
|
class << self
|
||||||
def log(message)
|
def log(message)
|
||||||
logger.info(message)
|
logger.tagged(Time.current) do
|
||||||
|
logger.info(message)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def path
|
def path
|
||||||
|
|||||||
@@ -38,4 +38,12 @@ describe AuthenticationLogger do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "log" do
|
||||||
|
it "includes current time in each log entry", :with_frozen_time do
|
||||||
|
expect_any_instance_of(ActiveSupport::TaggedLogging).to receive(:tagged).with(Time.current)
|
||||||
|
|
||||||
|
AuthenticationLogger.log("Just logging something!")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user