diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2019-02-13 16:42:32 -0600 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2019-02-13 16:42:32 -0600 |
commit | ed5565b97dfffe6178e27a1eaec1064b35721c01 (patch) | |
tree | 56a590c93eafc93bd7b2eae88665654da467e155 | |
parent | 6ee5298e8932a29aa3bd312d73c3f03c99e2d4ed (diff) | |
download | ATCD-ed5565b97dfffe6178e27a1eaec1064b35721c01.tar.gz |
Log_Msg: Allow flag macros to be overriden
-rw-r--r-- | ACE/NEWS | 6 | ||||
-rw-r--r-- | ACE/ace/Log_Msg.cpp | 12 | ||||
-rw-r--r-- | ACE/ace/Log_Msg.h | 10 |
3 files changed, 18 insertions, 10 deletions
@@ -7,7 +7,11 @@ USER VISIBLE CHANGES BETWEEN ACE-6.5.4 and ACE-6.5.5 . On Android, ACE_Log_Msg (and therefore ACE_DEBUG and ACE_ERROR) now uses Android's logging system (aka Logcat) by default in addition to stderr because stdout and stderr are discarded under normal circumstances. - Use ACE_LOG_MSG->clr_flags (ACE_Log_Msg::SYSLOG) to disable this. + To disable this at runtime, run: + ACE_LOG_MSG->clr_flags (ACE_Log_Msg::SYSLOG) + To disable this at compile time include these lines in config.h: + #define ACE_DEFAULT_LOG_FLAGS ACE_Log_Msg::STDERR + #define ACE_DEFAULT_LOG_BACKEND_FLAGS 0 USER VISIBLE CHANGES BETWEEN ACE-6.5.3 and ACE-6.5.4 ==================================================== diff --git a/ACE/ace/Log_Msg.cpp b/ACE/ace/Log_Msg.cpp index fbaafeed891..190c6d7815d 100644 --- a/ACE/ace/Log_Msg.cpp +++ b/ACE/ace/Log_Msg.cpp @@ -138,13 +138,15 @@ private: ACE_Log_Msg_Backend *ACE_Log_Msg_Manager::log_backend_ = 0; ACE_Log_Msg_Backend *ACE_Log_Msg_Manager::custom_backend_ = 0; -#ifdef ACE_ANDROID -# define DEFAULT_LOG_BACKEND_FLAGS ACE_Log_Msg::SYSLOG -#else -# define DEFAULT_LOG_BACKEND_FLAGS 0 +#ifndef ACE_DEFAULT_LOG_BACKEND_FLAGS +# ifdef ACE_ANDROID +# define ACE_DEFAULT_LOG_BACKEND_FLAGS ACE_Log_Msg::SYSLOG +# else +# define ACE_DEFAULT_LOG_BACKEND_FLAGS 0 +# endif #endif -u_long ACE_Log_Msg_Manager::log_backend_flags_ = DEFAULT_LOG_BACKEND_FLAGS; +u_long ACE_Log_Msg_Manager::log_backend_flags_ = ACE_DEFAULT_LOG_BACKEND_FLAGS; int ACE_Log_Msg_Manager::init_backend (const u_long *flags) { diff --git a/ACE/ace/Log_Msg.h b/ACE/ace/Log_Msg.h index e6fde3d1226..92c54cecbca 100644 --- a/ACE/ace/Log_Msg.h +++ b/ACE/ace/Log_Msg.h @@ -161,10 +161,12 @@ # undef THREAD #endif /* THREAD */ -#ifdef ACE_ANDROID -# define ACE_DEFAULT_LOG_FLAGS ACE_Log_Msg::STDERR | ACE_Log_Msg::SYSLOG -#else -# define ACE_DEFAULT_LOG_FLAGS ACE_Log_Msg::STDERR +#ifndef ACE_DEFAULT_LOG_FLAGS +# ifdef ACE_ANDROID +# define ACE_DEFAULT_LOG_FLAGS ACE_Log_Msg::STDERR | ACE_Log_Msg::SYSLOG +# else +# define ACE_DEFAULT_LOG_FLAGS ACE_Log_Msg::STDERR +# endif #endif ACE_BEGIN_VERSIONED_NAMESPACE_DECL |