|
|
@ -26,6 +26,7 @@ |
|
|
|
#include <log4cxx/propertyconfigurator.h> |
|
|
|
#include <log4cxx/propertyconfigurator.h> |
|
|
|
#include <log4cxx/helpers/properties.h> |
|
|
|
#include <log4cxx/helpers/properties.h> |
|
|
|
#include <fstream> |
|
|
|
#include <fstream> |
|
|
|
|
|
|
|
#include <cstdlib> |
|
|
|
|
|
|
|
|
|
|
|
#if (__GNUC__==3 && __GNUC_MINOR__<4 || __GNUC__<3) \ |
|
|
|
#if (__GNUC__==3 && __GNUC_MINOR__<4 || __GNUC__<3) \ |
|
|
|
&& defined(_REENTRANT) && !defined(_MT) |
|
|
|
&& defined(_REENTRANT) && !defined(_MT) |
|
|
@ -125,93 +126,93 @@ log4j.appender.A1.layout.ConversionPattern = \%-40l - \%m\%n |
|
|
|
logconfigfile = "/etc/mrwlog4cxx"; |
|
|
|
logconfigfile = "/etc/mrwlog4cxx"; |
|
|
|
if (logconfigfile.size()) { |
|
|
|
if (logconfigfile.size()) { |
|
|
|
log4cxx::PropertyConfigurator::configure |
|
|
|
log4cxx::PropertyConfigurator::configure |
|
|
|
(log4cxx::String(logconfigfile.begin(), logconfigfile.end())); |
|
|
|
(std::string(logconfigfile.begin(), logconfigfile.end())); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
log4cxx::helpers::Properties properties; |
|
|
|
log4cxx::helpers::Properties properties; |
|
|
|
std::string name, cont; |
|
|
|
std::string name, cont; |
|
|
|
properties.setProperty((name="log4j.rootLogger", |
|
|
|
properties.setProperty((name="log4j.rootLogger", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="WARN, A1", |
|
|
|
(cont="WARN, A1", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fntracea", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fntracea", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.log4cxx", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.log4cxx", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.boost", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.boost", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.Thread", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.Thread", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.QString", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.QString", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.QShared", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.QShared", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.QWidget", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.QWidget", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.QRect", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.QRect", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.qstrcmp", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.qstrcmp", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.*.qt_cast", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.*.qt_cast", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.mrw", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.mrw", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.std", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.std", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.CppUnit", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.CppUnit", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.__gnu_cxx", |
|
|
|
properties.setProperty((name="log4j.logger.mrw.fn.__gnu_cxx", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="OFF", |
|
|
|
(cont="OFF", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.appender.A1", |
|
|
|
properties.setProperty((name="log4j.appender.A1", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="org.apache.log4j.ConsoleAppender", |
|
|
|
(cont="org.apache.log4j.ConsoleAppender", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
properties.setProperty((name="log4j.appender.A1.layout", |
|
|
|
properties.setProperty((name="log4j.appender.A1.layout", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="org.apache.log4j.PatternLayout", |
|
|
|
(cont="org.apache.log4j.PatternLayout", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
#ifdef _MT |
|
|
|
#ifdef _MT |
|
|
|
properties.setProperty((name="log4j.appender.A1.layout.ConversionPattern", |
|
|
|
properties.setProperty((name="log4j.appender.A1.layout.ConversionPattern", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="%t-%-40l - %m%n", |
|
|
|
(cont="%t-%-40l - %m%n", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
#else |
|
|
|
#else |
|
|
|
properties.setProperty((name="log4j.appender.A1.layout.ConversionPattern", |
|
|
|
properties.setProperty((name="log4j.appender.A1.layout.ConversionPattern", |
|
|
|
log4cxx::String(name.begin(), name.end())), |
|
|
|
std::string(name.begin(), name.end())), |
|
|
|
(cont="%-40l - %m%n", |
|
|
|
(cont="%-40l - %m%n", |
|
|
|
log4cxx::String(cont.begin(), cont.end()))); |
|
|
|
std::string(cont.begin(), cont.end()))); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
log4cxx::PropertyConfigurator::configure(properties); |
|
|
|
log4cxx::PropertyConfigurator::configure(properties); |
|
|
|
} |
|
|
|
} |
|
|
|