-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[C++] Add C++ single file logger factory #10712
Merged
merlimat
merged 5 commits into
apache:master
from
BewareMyPower:bewaremypower/add-cpp-examples
May 29, 2021
Merged
[C++] Add C++ single file logger factory #10712
merlimat
merged 5 commits into
apache:master
from
BewareMyPower:bewaremypower/add-cpp-examples
May 29, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BewareMyPower
changed the title
[C++] Add SampleFileLogger C++ example
[C++] Add C++ example for customizing the logger factory
May 26, 2021
codelipenghui
approved these changes
May 26, 2021
merlimat
reviewed
May 26, 2021
BewareMyPower
changed the title
[C++] Add C++ example for customizing the logger factory
[WIP][C++] Add C++ example for customizing the logger factory
May 26, 2021
BewareMyPower
changed the title
[WIP][C++] Add C++ example for customizing the logger factory
[C++] Add C++ single file logger factory
May 27, 2021
It looks like there's something wrong with the build on CentOS 7, I'll take a look. |
@merlimat Done. PTAL again |
merlimat
reviewed
May 27, 2021
merlimat
approved these changes
May 28, 2021
merlimat
added
the
type/enhancement
The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
label
May 28, 2021
wangjialing218
pushed a commit
to wangjialing218/pulsar
that referenced
this pull request
May 31, 2021
* Add SampleFileLogger C++ example * Expose SingleFileLoggerFactory as the public interface * Make logger factory public * Change logger factory's name * Use PImpl idiom for LoggerFactory classes
yangl
pushed a commit
to yangl/pulsar
that referenced
this pull request
Jun 23, 2021
* Add SampleFileLogger C++ example * Expose SingleFileLoggerFactory as the public interface * Make logger factory public * Change logger factory's name * Use PImpl idiom for LoggerFactory classes
bharanic-dev
pushed a commit
to bharanic-dev/pulsar
that referenced
this pull request
Mar 18, 2022
* Add SampleFileLogger C++ example * Expose SingleFileLoggerFactory as the public interface * Make logger factory public * Change logger factory's name * Use PImpl idiom for LoggerFactory classes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
type/enhancement
The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Some users are confused about how to customize the logger in C++ client, while they don't want to build their own cpp library with log4cxx support and change the log4cxx.conf file.
Modifications
FileLoggerFactory
class to support writing logs to a single file.SimpleLoggerFactory
toConsoleLoggerFactory
to differ it withFileLoggerFactory
.LoggerFactory
classes.PULSAR_PUBLIC
to logger factory classes so that they can be exported.Verifying this change
This change is a trivial rework / code cleanup without any test coverage. If you ran the
SampleFileLogger
program in your local env without any pulsar server, apulsar-client-cpp.log
would be created and it contains the content like following.