Skip to content

Commit

Permalink
Print timestamp on output format
Browse files Browse the repository at this point in the history
  • Loading branch information
jnmoyne committed Jan 3, 2024
1 parent dca8399 commit 41678ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/sub_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ func (c *subCmd) printMsg(msg *nats.Msg, reply *nats.Msg, ctr uint) {

if info == nil {
if msg.Reply != "" {
fmt.Printf("[#%d] Received on %q with reply %q\n", ctr, msg.Subject, msg.Reply)
fmt.Printf("[#%d] Received at %v on %q with reply %q\n", ctr, time.Now().UnixMilli(), msg.Subject, msg.Reply)
} else {
fmt.Printf("[#%d] Received on %q\n", ctr, msg.Subject)
fmt.Printf("[#%d] Received at %v on %q\n", ctr, time.Now().UnixMilli(), msg.Subject)
}
} else if c.jetStream {
fmt.Printf("[#%d] Received JetStream message: stream: %s seq %d / subject: %s / time: %v\n", ctr, info.Stream(), info.StreamSequence(), msg.Subject, info.TimeStamp().Format(time.RFC3339))
Expand Down

0 comments on commit 41678ec

Please sign in to comment.