Skip to content

Commit

Permalink
Fix time in console output
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Sep 16, 2023
1 parent 926c52c commit e9466d9
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
3 changes: 2 additions & 1 deletion logging/hclog_adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package logging
import (
"context"
"testing"
"time"

"github.com/gatewayd-io/gatewayd/config"
"github.com/hashicorp/go-hclog"
Expand All @@ -20,7 +21,7 @@ func TestNewHcLogAdapter(t *testing.T) {
Output: []config.LogOutput{config.Console},
Level: zerolog.TraceLevel,
TimeFormat: zerolog.TimeFormatUnix,
ConsoleTimeFormat: config.DefaultConsoleTimeFormat,
ConsoleTimeFormat: time.RFC3339,
NoColor: true,
},
)
Expand Down
3 changes: 2 additions & 1 deletion logging/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"os"
"testing"
"time"

"github.com/gatewayd-io/gatewayd/config"
"github.com/rs/zerolog"
Expand Down Expand Up @@ -40,7 +41,7 @@ func TestNewLogger_File(t *testing.T) {
LoggerConfig{
Output: []config.LogOutput{config.File},
FileName: "gatewayd.log",
ConsoleTimeFormat: config.DefaultConsoleTimeFormat,
ConsoleTimeFormat: time.RFC3339,
MaxSize: config.DefaultMaxSize,
MaxBackups: config.DefaultMaxBackups,
MaxAge: config.DefaultMaxAge,
Expand Down
2 changes: 1 addition & 1 deletion metrics/merger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestMerger(t *testing.T) {
logging.LoggerConfig{
Output: []config.LogOutput{config.Console},
TimeFormat: zerolog.TimeFormatUnix,
ConsoleTimeFormat: config.DefaultConsoleTimeFormat,
ConsoleTimeFormat: time.RFC3339,
Level: zerolog.InfoLevel,
NoColor: true,
},
Expand Down
3 changes: 2 additions & 1 deletion network/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package network
import (
"context"
"testing"
"time"

"github.com/gatewayd-io/gatewayd/config"
"github.com/gatewayd-io/gatewayd/logging"
Expand All @@ -17,7 +18,7 @@ func CreateNewClient(t *testing.T) *Client {
logger := logging.NewLogger(context.Background(), logging.LoggerConfig{
Output: []config.LogOutput{config.Console},
TimeFormat: zerolog.TimeFormatUnix,
ConsoleTimeFormat: config.DefaultConsoleTimeFormat,
ConsoleTimeFormat: time.RFC3339,
Level: zerolog.DebugLevel,
NoColor: true,
})
Expand Down
5 changes: 3 additions & 2 deletions network/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package network
import (
"context"
"testing"
"time"

"github.com/gatewayd-io/gatewayd/config"
"github.com/gatewayd-io/gatewayd/logging"
Expand All @@ -17,7 +18,7 @@ func TestNewProxy(t *testing.T) {
logger := logging.NewLogger(context.Background(), logging.LoggerConfig{
Output: []config.LogOutput{config.Console},
TimeFormat: zerolog.TimeFormatUnix,
ConsoleTimeFormat: config.DefaultConsoleTimeFormat,
ConsoleTimeFormat: time.RFC3339,
Level: zerolog.DebugLevel,
NoColor: true,
})
Expand Down Expand Up @@ -80,7 +81,7 @@ func TestNewProxyElastic(t *testing.T) {
logger := logging.NewLogger(context.Background(), logging.LoggerConfig{
Output: []config.LogOutput{config.Console},
TimeFormat: zerolog.TimeFormatUnix,
ConsoleTimeFormat: config.DefaultConsoleTimeFormat,
ConsoleTimeFormat: time.RFC3339,
Level: zerolog.DebugLevel,
NoColor: true,
})
Expand Down
3 changes: 2 additions & 1 deletion network/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"os"
"testing"
"time"

v1 "github.com/gatewayd-io/gatewayd-plugin-sdk/plugin/v1"
"github.com/gatewayd-io/gatewayd/config"
Expand All @@ -29,7 +30,7 @@ func TestRunServer(t *testing.T) {
config.File,
},
TimeFormat: zerolog.TimeFormatUnix,
ConsoleTimeFormat: config.DefaultConsoleTimeFormat,
ConsoleTimeFormat: time.RFC3339,
Level: zerolog.DebugLevel,
NoColor: true,
FileName: "server_test.log",
Expand Down
5 changes: 3 additions & 2 deletions network/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package network
import (
"context"
"testing"
"time"

"github.com/gatewayd-io/gatewayd/config"
"github.com/gatewayd-io/gatewayd/logging"
Expand All @@ -15,7 +16,7 @@ func TestGetID(t *testing.T) {
cfg := logging.LoggerConfig{
Output: []config.LogOutput{config.Console},
TimeFormat: zerolog.TimeFormatUnix,
ConsoleTimeFormat: config.DefaultConsoleTimeFormat,
ConsoleTimeFormat: time.RFC3339,
Level: zerolog.DebugLevel,
NoColor: true,
}
Expand All @@ -30,7 +31,7 @@ func TestResolve(t *testing.T) {
cfg := logging.LoggerConfig{
Output: []config.LogOutput{config.Console},
TimeFormat: zerolog.TimeFormatUnix,
ConsoleTimeFormat: config.DefaultConsoleTimeFormat,
ConsoleTimeFormat: time.RFC3339,
Level: zerolog.DebugLevel,
NoColor: true,
}
Expand Down
3 changes: 2 additions & 1 deletion plugin/plugin_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package plugin
import (
"context"
"testing"
"time"

sdkPlugin "github.com/gatewayd-io/gatewayd-plugin-sdk/plugin"
v1 "github.com/gatewayd-io/gatewayd-plugin-sdk/plugin/v1"
Expand All @@ -19,7 +20,7 @@ func NewPluginRegistry(t *testing.T) *Registry {
cfg := logging.LoggerConfig{
Output: []config.LogOutput{config.Console},
TimeFormat: zerolog.TimeFormatUnix,
ConsoleTimeFormat: config.DefaultConsoleTimeFormat,
ConsoleTimeFormat: time.RFC3339,
Level: zerolog.DebugLevel,
NoColor: true,
}
Expand Down

0 comments on commit e9466d9

Please sign in to comment.