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

Logger: Remove stringstream in total #4484

Merged
merged 10 commits into from
Mar 30, 2022
Merged

Conversation

JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Mar 29, 2022

What problem does this PR solve?

Issue Number: close #4346, close #2179

Problem Summary:

What is changed and how it works?

  • Remove all stringstream in logging
  • Add filename and line number for LOG_XXX
  • Refine some comments in basedaemon

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 29, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • SeaRise
  • fuzhe1989

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 29, 2022
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@sre-bot
Copy link
Collaborator

sre-bot commented Mar 29, 2022

Coverage for changed files

Filename                                                Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
dbms/src/Client/Connection.cpp                              221               221     0.00%          32                32     0.00%         405               405     0.00%         130               130     0.00%
dbms/src/Storages/DeltaMerge/WriteBatches.h                 107                19    82.24%          14                 0   100.00%         197                12    93.91%          60                18    70.00%
libs/libcommon/include/common/logger_useful.h                12                 0   100.00%           4                 0   100.00%          15                 3    80.00%           6                 0   100.00%
libs/libdaemon/include/daemon/BaseDaemon.h                    9                 7    22.22%           9                 7    22.22%          34                32     5.88%           0                 0         -
libs/libdaemon/include/daemon/OwnPatternFormatter.h           1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
libs/libdaemon/src/BaseDaemon.cpp                           623               430    30.98%          40                20    50.00%         851               434    49.00%         380               278    26.84%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                       973               677    30.42%         100                59    41.00%        1503               886    41.05%         576               426    26.04%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
17050      9578             43.82%    191832  97054        49.41%

full coverage report (for internal network access only)

LOG_ERROR(log, "(from thread " << thread_num << ") "
<< "Received signal " << strsignal(sig) << " (" << sig << ")"
<< ".");
LOG_FMT_ERROR(log, "########################################");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe merge into one LOG?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will introduce lots of changes, maybe left it to another PR?

libs/libdaemon/src/tests/gtest_daemon_config.cpp Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 29, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 29, 2022
@ywqzzy
Copy link
Contributor

ywqzzy commented Mar 30, 2022

This pr is related to #2179.

@JaySon-Huang
Copy link
Contributor Author

This pr is related to #2179.

Thanks!

@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

@JaySon-Huang
Copy link
Contributor Author

@ywqzzy PTAL again

@JaySon-Huang
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

@JaySon-Huang: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 369e596

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 30, 2022
@sre-bot
Copy link
Collaborator

sre-bot commented Mar 30, 2022

Coverage for changed files

Filename                                                Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
dbms/src/Client/Connection.cpp                              221               221     0.00%          32                32     0.00%         405               405     0.00%         130               130     0.00%
dbms/src/Storages/DeltaMerge/WriteBatches.h                 107                19    82.24%          14                 0   100.00%         197                12    93.91%          60                18    70.00%
libs/libcommon/include/common/logger_useful.h                12                 0   100.00%           4                 0   100.00%          15                 3    80.00%           6                 0   100.00%
libs/libdaemon/include/daemon/BaseDaemon.h                    9                 7    22.22%           9                 7    22.22%          34                32     5.88%           0                 0         -
libs/libdaemon/include/daemon/OwnPatternFormatter.h           1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
libs/libdaemon/src/BaseDaemon.cpp                           623               430    30.98%          40                20    50.00%         851               434    49.00%         380               278    26.84%
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                       973               677    30.42%         100                59    41.00%        1503               886    41.05%         576               426    26.04%

Coverage summary

Functions  MissedFunctions  Executed  Lines   MissedLines  Cover
17069      9589             43.82%    192087  97182        49.41%

full coverage report (for internal network access only)

@ti-chi-bot ti-chi-bot merged commit a1b2035 into pingcap:master Mar 30, 2022
@JaySon-Huang JaySon-Huang deleted the fix_log_2 branch March 30, 2022 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logger: Replace LOG_XXX with LOG_FMT_XXX libdaemon comments
7 participants