22 ONIXS_HANDLER_NAMESPACE_BEGIN
25 using namespace HandlerCore::Common;
27 char last (
const std::string &str)
29 if(
size_t len = str.length())
36 bool oneof(
const char c,
const char( &literal)[N])
38 for(
int i = N; i; i--)
48 o.appendNoIndent(
"*", 1);
55 return o << name <<
'=';
59 TextBuilder & operator<<(TextBuilder & o, const VarFormatHelper<ValuePtr> & var)
64 return o <<
"\"" << var.value <<
"\"";
70 TextBuilder & operator<<(TextBuilder & o, const VarFormatHelper<char> & var)
75 return o <<
"'" << var.value <<
"'";
80 void userExceptionHandler(HandlerLogger* logger, OnixS::Logging::LogFacility *logFacility,
const char *contextName) ONIXS_NOEXCEPT
82 BOOST_ASSERT(logFacility);
83 BOOST_ASSERT(contextName);
89 catch(
const std::exception &ex)
92 logger->log( ONIXS_LOG_ERROR[logFacility] <<
"Exception inside " << contextName <<
" callback: " << ex.what());
97 logger->log( ONIXS_LOG_ERROR[logFacility] <<
"Unknown exception inside " << contextName <<
" callback.");
103 Logging::FileOutput::PermissionOption result = Logging::FileOutput::NoSet;
105 if(value & LogFilePermission::ReadOwnerOnly)
106 result = result | Logging::FileOutput::ReadOwner;
108 if(value & LogFilePermission::ReadAll)
109 result = result | Logging::FileOutput::ReadAll;
111 if(value & LogFilePermission::WriteOwnerOnly)
112 result = result | Logging::FileOutput::WriteOwner;
114 if(value & LogFilePermission::WriteAll)
115 result = result | Logging::FileOutput::WriteAll;
120 ONIXS_HANDLER_NAMESPACE_END
void userExceptionHandler(HandlerLogger *logger, OnixS::Logging::LogFacility *logFacility, const char *contextName) ONIXS_NOEXCEPT
TextBuilder & format_var_name(TextBuilder &o, ValuePtr name)
bool oneof(const char c, const char(&literal)[N])
Logging::FileOutput::PermissionOption getOutputPermission(LogFilePermission::Enum value)
char last(const std::string &str)
TextBuilder & format_null_value(TextBuilder &o)