mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 15:50:12 +00:00
TUN-3795: Use RFC-3339 style date format for logs, produce timestamp in UTC
This commit is contained in:
@@ -2,6 +2,7 @@ package origin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
@@ -145,3 +146,16 @@ func TestBackoffRetryForever(t *testing.T) {
|
||||
t.Fatalf("backoff returned %v instead of 8 seconds on fifth retry", duration)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPrint(t *testing.T) {
|
||||
local := time.Now()
|
||||
fmt.Printf("Local = %s\n", local)
|
||||
fmt.Printf("Local (kitchen) = %s\n", local.Format(time.Kitchen))
|
||||
fmt.Printf("Local (RFC3339) = %s\n", local.Format(time.RFC3339))
|
||||
fmt.Println()
|
||||
utc := local.UTC()
|
||||
fmt.Printf("UTC = %s\n", utc)
|
||||
fmt.Printf("UTC (kitchen) = %s\n", utc.Format(time.Kitchen))
|
||||
fmt.Printf("UTC (RFC3339) = %s\n", utc.Format(time.RFC3339))
|
||||
|
||||
}
|
Reference in New Issue
Block a user