Skip to content

Commit

Permalink
converted Time property to int
Browse files Browse the repository at this point in the history
  • Loading branch information
iolave committed Jul 29, 2024
1 parent 8340156 commit fe90816
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion log_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type LogEntry struct {
Level LogLevel `json:"level"`
Name string `json:"name"`
Msg string `json:"msg"`
Time string `json:"time"`
Time int `json:"time"`
Pid int `json:"pid"`
Hostname string `json:"hostname"`
SchemaVersion string `json:"schemaVersion"`
Expand Down
3 changes: 1 addition & 2 deletions logger.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package logger

import (
"fmt"
"os"
"time"

Expand Down Expand Up @@ -52,7 +51,7 @@ func (log Logger) buildLogEntry(level LogLevel, msg string, customData map[strin
// Setting base log entry fields
entry.Name = log.name
entry.Level = level
entry.Time = fmt.Sprintf("%d", time.Now().Unix())
entry.Time = int(time.Now().Unix())
entry.Pid = os.Getpid()
entry.Hostname = hostname
entry.SchemaVersion = "v1.0.0" // TODO: Add schema definition in README.md
Expand Down

0 comments on commit fe90816

Please sign in to comment.