Skip to content

Commit

Permalink
Log_Msg: Allow flag macros to be overriden
Browse files Browse the repository at this point in the history
  • Loading branch information
iguessthislldo committed Feb 13, 2019
1 parent 6ee5298 commit ed5565b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
6 changes: 5 additions & 1 deletion ACE/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
====================================================
Expand Down
12 changes: 7 additions & 5 deletions ACE/ace/Log_Msg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,15 @@ class ACE_Log_Msg_Manager
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)
{
Expand Down
10 changes: 6 additions & 4 deletions ACE/ace/Log_Msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ed5565b

Please sign in to comment.