Skip to content

Commit

Permalink
Merge pull request #115 from equinor/change-log-time-format
Browse files Browse the repository at this point in the history
change log time format to rfc3339
  • Loading branch information
nilsgstrabo authored Mar 15, 2024
2 parents c09c54c + fb56451 commit 98745bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/utils/git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func tearDownGitTest() {
}

func TestGetGitCommitHashFromHead_DummyRepo2(t *testing.T) {
setupLog(t)
setupLog()
gitDirPath := setupGitTest("test_data2.zip", "test_data2")

releaseBranchHeadCommitHash := "a1ee44808de2a42d291b59fefb5c66b8ff6bf898"
Expand All @@ -122,7 +122,7 @@ func TestGetGitCommitHashFromHead_DummyRepo2(t *testing.T) {
}

func TestGetGitCommitTags(t *testing.T) {
setupLog(t)
setupLog()
gitDirPath := setupGitTest("test_data.zip", "test_data")

branchName := "branch-with-tags"
Expand All @@ -143,7 +143,7 @@ func TestGetGitCommitTags(t *testing.T) {
}

func TestGetGitChangedFolders_DummyRepo(t *testing.T) {
setupLog(t)
setupLog()
scenarios := []struct {
name string
beforeCommitExclusive string
Expand Down Expand Up @@ -395,6 +395,6 @@ func TestGetGitChangedFolders_DummyRepo(t *testing.T) {
tearDownGitTest()
}

func setupLog(t *testing.T) {
func setupLog() {
logger.InitializeLogger(zerolog.DebugLevel, true)
}
2 changes: 1 addition & 1 deletion pkg/utils/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func InitializeLogger(logLevel zerolog.Level, prettyPrint bool) {
zerolog.SetGlobalLevel(logLevel)
zerolog.DurationFieldUnit = time.Millisecond
if prettyPrint {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.TimeOnly})
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.RFC3339})
}

zerolog.DefaultContextLogger = &log.Logger
Expand Down

0 comments on commit 98745bc

Please sign in to comment.