Skip to content

Commit

Permalink
Take timestamp as an argument in Log::Entry initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija committed Aug 3, 2020
1 parent 3857fbb commit 1e6a09d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/log/entry.cr
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ struct Log::Entry
getter source : String
getter severity : Severity
getter message : String
getter timestamp = Time.local
getter timestamp : Time
getter context : Metadata = Log.context.metadata
getter data : Metadata
getter exception : Exception?

def initialize(@source : String, @severity : Severity, @message : String, @data : Log::Metadata, @exception : Exception?)
def initialize(@source : String, @severity : Severity, @message : String, @data : Log::Metadata, @exception : Exception?, *, @timestamp = Time.local)
end
end

0 comments on commit 1e6a09d

Please sign in to comment.