cloudfoundry / cloudfoundry/cli
Log level does not support the "trace" keyword
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 990
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 8
Description
Please fill out the issue checklist below and provide ALL the requested information.
- I reviewed open and closed github issues that may be related to my problem.
- I tried updating to the latest version of the CF CLI to see if it fixed my problem.
- I attempted to run the command with
CF_TRACE=1to help debug the issue. - I am reporting a bug that others will be able to reproduce.
Describe the bug and the command you saw an issue with
While working on code changes I noticed that I wasn't able to see logs if I set the log level to trace. It turns out that the log level using the trace keyword isn't supported although it has been added to the logger 7 years ago.
What happened
Notice that a debug log is being printed when I use the debug level
$ CF_LOG_LEVEL=debug cf create-package hello
Creating and uploading bits package for app hello in org myorg / space myspace as john.doe@example.com...
DEBU[0000] convert to translatable error err="actionerror.ApplicationNotFoundError{GUID:\"\", Name:\"hello\"}"
App 'hello' not found.
FAILED
but that if I set the log level to trace the debug printout does not appear.
$ CF_LOG_LEVEL=trace cf create-package hello
Creating and uploading bits package for app hello in org myorg / space myspace as john.doe@example.com...
App 'hello' not found.
FAILED
however, if I set the debug level to 6, which corresponds to trace it does show:
$ CF_LOG_LEVEL=6 cf create-package hello
Creating and uploading bits package for app hello in org myorg / space myspace as john.doe@example.com...
DEBU[0000] convert to translatable error err="actionerror.ApplicationNotFoundError{GUID:\"\", Name:\"hello\"}"
App 'hello' not found.
FAILED
Expected behavior
I should be able to use CF_LOG_LEVEL=trace
Exact Steps To Reproduce
See above.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Cloud Foundry CLI's log-level parsing and configuration, then reproduce the difference between CF_LOG_LEVEL=debug, CF_LOG_LEVEL=trace, and CF_LOG_LEVEL=6 using cf create-package hello. Done means the trace keyword produces the same logging behavior as numeric level 6, with a regression test covering the setting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100