summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hornsey <hornseyf@objectcomputing.com>2019-02-13 16:42:32 -0600
committerFred Hornsey <hornseyf@objectcomputing.com>2019-02-13 16:42:32 -0600
commited5565b97dfffe6178e27a1eaec1064b35721c01 (patch)
tree56a590c93eafc93bd7b2eae88665654da467e155
parent6ee5298e8932a29aa3bd312d73c3f03c99e2d4ed (diff)
downloadATCD-ed5565b97dfffe6178e27a1eaec1064b35721c01.tar.gz
Log_Msg: Allow flag macros to be overriden
-rw-r--r--ACE/NEWS6
-rw-r--r--ACE/ace/Log_Msg.cpp12
-rw-r--r--ACE/ace/Log_Msg.h10
3 files changed, 18 insertions, 10 deletions
diff --git a/ACE/NEWS b/ACE/NEWS
index 1222bd1d994..fd9c670b35e 100644
--- a/ACE/NEWS
+++ b/ACE/NEWS
@@ -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