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

fix no print to console #4993

Closed

Conversation

panda-sheep
Copy link
Contributor

@panda-sheep panda-sheep commented Dec 6, 2022

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

Description:

fix the enterprise version problem(close https://github.com/vesoft-inc/nebula-ent/issues/1813 ), the community version also exists, just submit it in the community version:

1 Before the FLAGS_log_dir directory is generated, you can use LOG(ERROR) to print errors to standard output, but you cannot use vlog to print log information. The reasons are as follows:

Calling vlog before creating the FLAGS_log_dir directory will cause the following error message:

Could not create logging file: No such file or directory
COULD NOT CREATE A LOGGINGFILE 20221205-164038.3542522!

This information is not what we want to output.

Calling LOG(ERROR) before creating the FLAGS_log_dir directory will cause an error message similar to the following:

WARNING: Logging before InitGoogleLogging() is written to STDERR
E20221205 17:31:35.309763 3455851 StorageDaemon.cpp:71] pids_listener/nebula-storaged.pid: Success

Here, because there is no FLAGS_log_dir directory, it is reasonable to print the error to the standard err.

2 vlog Information in FileUtils::fileType is redundant and meaningless, so remove them.

How do you solve it?

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

@SuperYoko
Copy link
Contributor

Maybe clone an issue here to make all your links accessable.

@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2022

Codecov Report

Base: 76.86% // Head: 76.83% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (626a44f) compared to base (8adec8d).
Patch coverage: 91.83% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4993      +/-   ##
==========================================
- Coverage   76.86%   76.83%   -0.04%     
==========================================
  Files        1105     1105              
  Lines       81432    81464      +32     
==========================================
- Hits        62594    62589       -5     
- Misses      18838    18875      +37     
Impacted Files Coverage Δ
src/common/fs/FileUtils.cpp 74.07% <ø> (+0.40%) ⬆️
src/graph/executor/query/TraverseExecutor.h 100.00% <ø> (ø)
src/meta/processors/parts/ListHostsProcessor.cpp 69.52% <0.00%> (-2.77%) ⬇️
src/daemons/MetaDaemon.cpp 68.37% <33.33%> (ø)
src/clients/meta/MetaClient.cpp 76.34% <100.00%> (-0.17%) ⬇️
src/common/function/FunctionManager.cpp 79.40% <100.00%> (+0.12%) ⬆️
src/graph/optimizer/rule/PushEFilterDownRule.cpp 78.35% <100.00%> (-0.44%) ⬇️
src/meta/processors/admin/HBProcessor.cpp 89.04% <100.00%> (+0.15%) ⬆️
src/meta/processors/job/StorageJobExecutor.cpp 78.99% <100.00%> (ø)
src/meta/processors/listener/ListenerProcessor.cpp 69.90% <100.00%> (ø)
... and 38 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@panda-sheep
Copy link
Contributor Author

Maybe clone an issue here to make all your links accessable.

okey

@panda-sheep
Copy link
Contributor Author

close #4994

@liwenhui-soul
Copy link
Contributor

liwenhui-soul commented Dec 6, 2022

don't merge plz, the log could not be removed directly. have talked with qa, this issue don't need to fix because it only happen in v3. if the issue is really need to fix, I suggest refactor the mkdir function to make sure it won't affect other place's log.

@critical27
Copy link
Contributor

Not a big issue, print some unexpected log before setting up glog is reasonable. And this log is a v3 log, we won't use it for any production env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants