mirror of
https://github.com/status-im/status-go.git
synced 2025-01-18 02:31:47 +00:00
2ced83abb7
closes: #6002
25 lines
472 B
Go
25 lines
472 B
Go
package logutils
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
func WakuMessageTimestamp(key string, value *int64) zap.Field {
|
|
valueStr := "-"
|
|
if value != nil {
|
|
valueStr = fmt.Sprintf("%d", *value)
|
|
}
|
|
return zap.String(key, valueStr)
|
|
}
|
|
|
|
func UnixTimeMs(key string, t time.Time) zap.Field {
|
|
return zap.String(key, fmt.Sprintf("%d", t.UnixMilli()))
|
|
}
|
|
|
|
func UnixTimeNano(key string, t time.Time) zap.Field {
|
|
return zap.String(key, fmt.Sprintf("%d", t.UnixNano()))
|
|
}
|