-
Notifications
You must be signed in to change notification settings - Fork 182
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
[logging] API change for ecal logging #1853
Changes from all commits
7d38709
8fe56f5
2af39ae
e2d0cab
4b1bc68
d07d20d
4a64f0b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,19 +29,9 @@ | |
|
||
extern "C" | ||
{ | ||
ECALC_API void eCAL_Logging_SetLogLevel(enum eCAL_Logging_eLogLevel level_) | ||
ECALC_API void eCAL_Logging_Log(enum eCAL_Logging_eLogLevel level_, const char* const msg_) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "ECALC_API" is directly included [misc-include-cleaner] ecal/core/src/cimpl/ecal_log_cimpl.cpp:27: - #include "ecal_common_cimpl.h"
+ #include "ecal/ecal_os.h"
+ #include "ecal_common_cimpl.h" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "eCAL_Logging_eLogLevel" is directly included [misc-include-cleaner] ecal/core/src/cimpl/ecal_log_cimpl.cpp:27: - #include "ecal_common_cimpl.h"
+ #include "ecal/ecal_log_level.h"
+ #include "ecal_common_cimpl.h" |
||
{ | ||
eCAL::Logging::SetLogLevel(level_); | ||
} | ||
|
||
ECALC_API enum eCAL_Logging_eLogLevel eCAL_Logging_GetLogLevel() | ||
{ | ||
return(eCAL::Logging::GetLogLevel()); | ||
} | ||
|
||
ECALC_API void eCAL_Logging_Log(const char* const msg_) | ||
{ | ||
eCAL::Logging::Log(msg_); | ||
eCAL::Logging::Log(level_, msg_); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "eCAL::Logging::Log" is directly included [misc-include-cleaner] ecal/core/src/cimpl/ecal_log_cimpl.cpp:27: - #include "ecal_common_cimpl.h"
+ #include "ecal/ecal_log.h"
+ #include "ecal_common_cimpl.h" |
||
} | ||
|
||
ECALC_API int eCAL_Logging_GetLogging(void* buf_, int buf_len_) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,65 +32,14 @@ namespace eCAL | |
{ | ||
namespace Logging | ||
{ | ||
/** | ||
* @brief Sets the log level. | ||
* | ||
* @param level_ The level. | ||
**/ | ||
void SetLogLevel(const eCAL_Logging_eLogLevel level_) | ||
{ | ||
if(g_log_provider() != nullptr) g_log_provider()->SetLogLevel(level_); | ||
} | ||
|
||
/** | ||
* @brief Sets the file log filter. | ||
* | ||
* @param filter_ The filter; | ||
*/ | ||
void SetFileLogFilter(eCAL_Logging_Filter filter_) | ||
{ | ||
if(g_log_provider() != nullptr) g_log_provider()->SetFileLogFilter(filter_); | ||
} | ||
|
||
/** | ||
* @brief Sets the udp log filter. | ||
* | ||
* @param filter_ The filter; | ||
*/ | ||
void SetUDPLogFilter(eCAL_Logging_Filter filter_) | ||
{ | ||
if(g_log_provider() != nullptr) g_log_provider()->SetUDPLogFilter(filter_); | ||
} | ||
|
||
/** | ||
* @brief Sets the console log filter. | ||
* | ||
* @param filter_ The filter; | ||
*/ | ||
void SetConsoleLogFilter(eCAL_Logging_Filter filter_) | ||
{ | ||
if(g_log_provider() != nullptr) g_log_provider()->SetConsoleLogFilter(filter_); | ||
} | ||
|
||
/** | ||
* @brief Get the current log level. | ||
* | ||
* @return The current log level. | ||
**/ | ||
eCAL_Logging_eLogLevel GetLogLevel() | ||
{ | ||
if(g_log_provider() != nullptr) return(g_log_provider()->GetLogLevel()); | ||
else return(log_level_none); | ||
} | ||
|
||
/** | ||
* @brief Log a message. | ||
* | ||
* @param msg_ The log message string. | ||
**/ | ||
void Log(const std::string& msg_) | ||
void Log(eCAL_Logging_eLogLevel level_, const std::string& msg_) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "eCAL_Logging_eLogLevel" is directly included [misc-include-cleaner] ecal/core/src/logging/ecal_log.cpp:26: - #include "ecal_log_provider.h"
+ #include "ecal/ecal_log_level.h"
+ #include "ecal_log_provider.h" |
||
{ | ||
if(g_log_provider() != nullptr) g_log_provider()->Log(msg_); | ||
if(g_log_provider() != nullptr) g_log_provider()->Log(level_, msg_); | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,7 @@ int main(int argc, char **argv) | |
msgs = 0; | ||
bytes = 0; | ||
|
||
eCAL::Logging::Log(out.str()); | ||
eCAL::Logging::Log(log_level_info, out.str()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "eCAL::Logging::Log" is directly included [misc-include-cleaner] ecal/samples/cpp/benchmarks/counter_snd/src/counter_snd.cpp:19: - #include <ecal/ecal.h>
+ #include "ecal/ecal_log.h"
+ #include <ecal/ecal.h> There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "log_level_info" is directly included [misc-include-cleaner] ecal/samples/cpp/benchmarks/counter_snd/src/counter_snd.cpp:19: - #include <ecal/ecal.h>
+ #include "ecal/ecal_log_level.h"
+ #include <ecal/ecal.h> |
||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,7 @@ int main(int argc, char **argv) | |
out << "Messages/s: " << (unsigned int)(msgs / diff_time.count()) << std::endl; | ||
out << "Latency (us): " << (diff_time.count() * 1e6) / (double)msgs << std::endl; | ||
std::cout << out.str() << std::endl; | ||
eCAL::Logging::Log(out.str()); | ||
eCAL::Logging::Log(log_level_info, out.str()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "eCAL::Logging::Log" is directly included [misc-include-cleaner] ecal/samples/cpp/benchmarks/performance_snd/src/performance_snd.cpp:27: + #include "ecal/ecal_log.h" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "log_level_info" is directly included [misc-include-cleaner] ecal/samples/cpp/benchmarks/performance_snd/src/performance_snd.cpp:27: + #include "ecal/ecal_log_level.h" |
||
|
||
// reset counter | ||
msgs = 0; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: parameter 'msg_' is const-qualified in the function declaration; const-qualification of parameters only has an effect in function definitions [readability-avoid-const-params-in-decls]