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 C++ log level names in Log4cxxLogger #4735

Merged
merged 1 commit into from
Jul 19, 2019

Conversation

massakam
Copy link
Contributor

Motivation

If trying to build master C++ code with the USE_LOG4CXX flag turned ON, compilation errors occur:

/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc: In static member function ‘static log4cxx::LevelPtr pulsar::Log4CxxLogger::getLevel(pulsar::Logger::Level)’:
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:53:18: error: ‘DEBUG’ was not declared in this scope
             case DEBUG:
                  ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:55:18: error: ‘INFO’ was not declared in this scope
             case INFO:
                  ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:57:18: error: ‘WARN’ was not declared in this scope
             case WARN:
                  ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:59:18: error: ‘ERROR’ was not declared in this scope
             case ERROR:
                  ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_DEBUG’ not handled in switch [-Werror=switch]
         switch (level) {
                ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_INFO’ not handled in switch [-Werror=switch]
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_WARN’ not handled in switch [-Werror=switch]
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_ERROR’ not handled in switch [-Werror=switch]
cc1plus: some warnings being treated as errors
make[2]: *** [lib/CMakeFiles/pulsarStatic.dir/Log4cxxLogger.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....

This is because the enum values renamed in #4664 are still used in Log4cxxLogger.cc.

Modifications

Fixed the enum values used in Log4cxxLogger.cc by adding the prefix LEVEL_.

Verifying this change

  • Make sure that the change passes the CI checks.

@massakam massakam added type/bug The PR fixed a bug or issue reported a bug component/c++ labels Jul 16, 2019
@massakam massakam added this to the 2.4.1 milestone Jul 16, 2019
@massakam massakam self-assigned this Jul 16, 2019
@massakam
Copy link
Contributor Author

rerun integration tests

@sijie
Copy link
Member

sijie commented Jul 17, 2019

run java8 tests
run integration tests

@massakam
Copy link
Contributor Author

rerun cpp tests
rerun integration tests

@massakam
Copy link
Contributor Author

rerun integration tests

@sijie sijie merged commit af8ea71 into apache:master Jul 19, 2019
@massakam massakam deleted the log4cxx-log-level branch July 19, 2019 07:15
easyfan pushed a commit to easyfan/pulsar that referenced this pull request Jul 26, 2019
### Motivation

If trying to build master C++ code with the `USE_LOG4CXX` flag turned ON, compilation errors occur:
```
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc: In static member function ‘static log4cxx::LevelPtr pulsar::Log4CxxLogger::getLevel(pulsar::Logger::Level)’:
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:53:18: error: ‘DEBUG’ was not declared in this scope
             case DEBUG:
                  ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:55:18: error: ‘INFO’ was not declared in this scope
             case INFO:
                  ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:57:18: error: ‘WARN’ was not declared in this scope
             case WARN:
                  ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:59:18: error: ‘ERROR’ was not declared in this scope
             case ERROR:
                  ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_DEBUG’ not handled in switch [-Werror=switch]
         switch (level) {
                ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_INFO’ not handled in switch [-Werror=switch]
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_WARN’ not handled in switch [-Werror=switch]
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_ERROR’ not handled in switch [-Werror=switch]
cc1plus: some warnings being treated as errors
make[2]: *** [lib/CMakeFiles/pulsarStatic.dir/Log4cxxLogger.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
```

This is because the enum values renamed in apache#4664 are still used in `Log4cxxLogger.cc`.

### Modifications

Fixed the enum values used in `Log4cxxLogger.cc` by adding the prefix `LEVEL_`.
jiazhai pushed a commit that referenced this pull request Aug 28, 2019
### Motivation

If trying to build master C++ code with the `USE_LOG4CXX` flag turned ON, compilation errors occur:
```
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc: In static member function ‘static log4cxx::LevelPtr pulsar::Log4CxxLogger::getLevel(pulsar::Logger::Level)’:
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:53:18: error: ‘DEBUG’ was not declared in this scope
             case DEBUG:
                  ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:55:18: error: ‘INFO’ was not declared in this scope
             case INFO:
                  ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:57:18: error: ‘WARN’ was not declared in this scope
             case WARN:
                  ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:59:18: error: ‘ERROR’ was not declared in this scope
             case ERROR:
                  ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_DEBUG’ not handled in switch [-Werror=switch]
         switch (level) {
                ^
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_INFO’ not handled in switch [-Werror=switch]
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_WARN’ not handled in switch [-Werror=switch]
/tmp/pulsar/pulsar-client-cpp/lib/Log4cxxLogger.cc:52:16: error: enumeration value ‘LEVEL_ERROR’ not handled in switch [-Werror=switch]
cc1plus: some warnings being treated as errors
make[2]: *** [lib/CMakeFiles/pulsarStatic.dir/Log4cxxLogger.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
```

This is because the enum values renamed in #4664 are still used in `Log4cxxLogger.cc`.

### Modifications

Fixed the enum values used in `Log4cxxLogger.cc` by adding the prefix `LEVEL_`.

(cherry picked from commit af8ea71)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants