Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Honor the log-format parameter for debug logs #988

Merged
merged 1 commit into from
Jun 21, 2019

Conversation

divolgin
Copy link
Member

@divolgin divolgin commented Jun 21, 2019

What I Did

Made debug logger honor the log-format command line parameter. This closes #886.

How I Did it

Removed the hardcoded call to NewJSONLogger.

How to verify it

Run ship, look at debug logs. Instead of this:

$ tail -f .ship/debug.log 
{"caller":"github.com/replicatedhq/ship/pkg/state/manager.go","level":"debug","msg":"no saved state exists","path":".ship/state.json","ts":"2019-06-21T22:24:32.557732Z"}
{"caller":"github.com/replicatedhq/ship/pkg/state/manager.go","level":"debug","method":"serializeAndWriteState","stateFrom":"file","ts":"2019-06-21T22:24:32.557762Z"}
{"caller":"github.com/replicatedhq/ship/pkg/specs/interface.go","event":"applicationType.resolve","level":"debug","method":"ResolveRelease","ts":"2019-06-21T22:24:32.558395Z","type":"replicated.app"}

there should be this:

$ tail -f .ship/debug.log 
ts=2019-06-21T22:27:08.532125Z caller=github.com/replicatedhq/ship/pkg/state/manager.go level=debug msg="no saved state exists" path=.ship/state.json
ts=2019-06-21T22:27:08.532148Z caller=github.com/replicatedhq/ship/pkg/state/manager.go level=debug method=serializeAndWriteState stateFrom=file
ts=2019-06-21T22:27:08.532698Z caller=github.com/replicatedhq/ship/pkg/specs/interface.go level=debug method=ResolveRelease event=applicationType.resolve type=replicated.app

Description for the Changelog

Debug logger honors the log-format command line parameter

Picture of a Ship (not required but encouraged)

___________|

@divolgin divolgin merged commit 0c6d18d into replicatedhq:master Jun 21, 2019
@divolgin divolgin deleted the logging branch June 24, 2019 22:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal: Unstructured (pretty) log output to stdout/stderr
2 participants