Skip to content

Commit

Permalink
Add a new DIRECT_SYSLOG macro to use only when the messaging engine i…
Browse files Browse the repository at this point in the history
…s not running yet
  • Loading branch information
VeithMetro committed Feb 19, 2025
1 parent be0eb25 commit be42ec5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 8 additions & 8 deletions Source/Thunder/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ namespace PluginHost {
_ethernetCard = config.EthernetCard.Value();
_delegatedReleases = config.DelegatedReleases.Value();
if( config.Latitude.IsSet() || config.Longitude.IsSet() ) {
SYSLOG(Logging::Error, (_T("Support for Latitude and Longitude moved from Thunder configuration to plugin providing ILocation support")));
DIRECT_SYSLOG("Support for Latitude and Longitude moved from Thunder configuration to plugin providing ILocation support\n");
}

_messagingCategoriesFile = config.DefaultMessagingCategories.IsQuoted();
Expand All @@ -717,12 +717,12 @@ namespace PluginHost {
Core::JSON::ArrayType<Plugin::Config::Environment>::ConstIterator index(static_cast<const JSONConfig&>(config).Environments.Elements());
while (index.Next() == true) {
if (index.Current().Key.IsSet() == false) {
SYSLOG(Logging::Startup, (_T("Failure n setting an environmet variable. Empty key defined!!\n")));
DIRECT_SYSLOG("Failure in setting an environmet variable. Empty key defined!!\n");
}
else {
string value = _substituter.Substitute(index.Current().Value.Value(), nullptr);
if (Core::SystemInfo::SetEnvironment(index.Current().Key.Value(), value, ((index.Current().Scope.Value() == RPC::Environment::scope::GLOBAL) ? true : false)) != true) {
SYSLOG(Logging::Startup, (_T("Failure in setting Key:Value:[%s]:[%s]\n"), index.Current().Key.Value().c_str(), index.Current().Value.Value().c_str()));
DIRECT_SYSLOG("Failure in setting Key:Value:[%s]:[%s]\n", index.Current().Key.Value().c_str(), index.Current().Value.Value().c_str());
}
}
}
Expand Down Expand Up @@ -976,7 +976,7 @@ namespace PluginHost {
_accessor.PortNumber(_portNumber);
hostaddress = _accessor.HostAddress();
_configLock.Unlock();
SYSLOG(Logging::Startup, ("Invalid config information could not resolve to a proper IP"));
DIRECT_SYSLOG("Invalid config information could not resolve to a proper IP\n");
} else {
_accessor.PortNumber(_portNumber);
hostaddress= _accessor.HostAddress();
Expand All @@ -991,8 +991,8 @@ namespace PluginHost {
}


SYSLOG(Logging::Startup, (_T("Accessor: %s"), _URL.c_str()));
SYSLOG(Logging::Startup, (_T("Interface IP: %s"), hostaddress.c_str()));
DIRECT_SYSLOG("Accessor: %s\n", _URL.c_str());
DIRECT_SYSLOG("Interface IP: %s\n", hostaddress.c_str());

}

Expand All @@ -1017,12 +1017,12 @@ namespace PluginHost {
else {
_binder.PortNumber(_portNumber);
}
SYSLOG(Logging::Startup, (_T("Binder: [%s:%d]"), _binder.HostAddress().c_str(), _binder.PortNumber()));
DIRECT_SYSLOG("Binder: [%s:%d]\n", _binder.HostAddress().c_str(), _binder.PortNumber());
}

inline void Security(ISecurity* security)
{
ASSERT((_security == nullptr) && (security != nullptr));
INTERNAL_ASSERT((_security == nullptr) && (security != nullptr));

_security = security;

Expand Down
6 changes: 4 additions & 2 deletions Source/core/Trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ namespace Thunder {
fflush(stderr); \
} while (0)
#endif
#

#endif

#if defined(CORE_TRACE_NOT_ALLOWED) && !defined(__WINDOWS__)
#define TRACE_FORMATTING(fmt, ...) \
_Pragma ("GCC warning \"Using 'TRACE_Lx' outside of Thunder Core is deprecated\"") \
_Pragma ("GCC warning \"Using 'TRACE_Lx' outside of Thunder Core or `DIRECT_SYSLOG` with the messaging engine running is deprecated\"") \
TRACE_FORMATTING_IMPL(fmt, ##__VA_ARGS__)
#else
#define TRACE_FORMATTING(fmt, ...) \
Expand Down Expand Up @@ -158,6 +158,8 @@ namespace Thunder {
#undef VERIFY
#endif

#define DIRECT_SYSLOG(x, ...) TRACE_FORMATTING("<1>: " x, ##__VA_ARGS__)

#if defined(__DEBUG__) || defined(_THUNDER_PRODUCTION)

#ifdef __DEBUG__
Expand Down

0 comments on commit be42ec5

Please sign in to comment.