Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce logger.Initialise when writing unite test #148

Open
jamieabc opened this issue Mar 12, 2020 · 2 comments
Open

Reduce logger.Initialise when writing unite test #148

jamieabc opened this issue Mar 12, 2020 · 2 comments
Assignees

Comments

@jamieabc
Copy link
Contributor

Current logger package needs to be initialised before using. This increase some complexity when writing unit test.

Not only every test case need to initialize logger, but also when background task is running while main test problem is terminating and finalize logger, it might cause unexpected problem of logger not initialised.

If logger can be default send to stdout, then it provides two benefits:

  • no need to setup logger for ever test
  • when ever unit test error, with go test -v shows details message of process, facilitate easier debugging
@jamieabc jamieabc self-assigned this Mar 12, 2020
@hxw
Copy link
Member

hxw commented Mar 20, 2020

When fixed must revert this commit:
88330ad

(the commit comments out some logs that case a panic on the existing log system)

@jamieabc
Copy link
Contributor Author

jamieabc commented Mar 24, 2020

Expected behavior:

  1. If logger.Initialise is not called, log should go to standard out
  2. if logger.Initialise is called, log should go to file
  3. if logger.Finalise is called, log message goes to standard out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants