: m_Ident(ident), m_Flags(
flags),
62m_DefaultFacility((default_facility == eDefaultFacility) ? 0
63: x_TranslateFacility(default_facility))
67 "CSysLog not implemented for this platform");
76: m_Ident(ident), m_Flags(
flags), m_DefaultFacility(default_facility)
80 "CSysLog not implemented for this platform");
112 default: priority =
eNotice;
break;
114 Post(message_str, priority);
132syslog(
LOG_MAKEPRI(facility, priority),
"[%d] %s",
133getpid(), message.c_str());
137syslog(
LOG_MAKEPRI(facility, priority),
"%s", message.c_str());
142clog << message << endl;
146clog << message << endl;
156 " fNoOverride is incompatible with other flags.");
166<<
"CSysLog::x_TranslateFlags: ignoring extra flags.");
189 # elif defined(LOG_ODELAY) 208 case eKernel:
returnLOG_KERN;
209 case eUser:
returnLOG_USER;
210 case eMail:
returnLOG_MAIL;
211 case eDaemon:
returnLOG_DAEMON;
212 case eAuth:
returnLOG_AUTH;
213 case eSysLog:
returnLOG_SYSLOG;
214 case eLPR:
returnLOG_LPR;
215 case eNews:
returnLOG_NEWS;
216 case eUUCP:
returnLOG_UUCP;
217 case eCron:
returnLOG_CRON;
224 case eFTP:
returnLOG_FTP;
226 case eLocal0:
returnLOG_LOCAL0;
227 case eLocal1:
returnLOG_LOCAL1;
228 case eLocal2:
returnLOG_LOCAL2;
229 case eLocal3:
returnLOG_LOCAL3;
230 case eLocal4:
returnLOG_LOCAL4;
231 case eLocal5:
returnLOG_LOCAL5;
232 case eLocal6:
returnLOG_LOCAL6;
233 case eLocal7:
returnLOG_LOCAL7;
261 stringfac_name = reg->
Get(
"LOG",
"SysLogFacility");
262 if( !fac_name.empty() ){
265 if(fac_name.size() == 6
267&& fac_name[5] >=
'0'&& fac_name[5] <=
'7') {
static CNcbiApplication * Instance(void)
Singleton method.
const CNcbiRegistry & GetConfig(void) const
Get the application's cached configuration parameters (read-only).
void Write(string &str, TDiagWriteFlags flags=fNone) const
Binary OR of "EDiagWriteFlags".
EDiagSev m_Severity
Severity level.
CSysLog(const string &ident=kEmptyStr, TFlags flags=fNoOverride, EFacility default_facility=eDefaultFacility)
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
static int x_TranslateFlags(TFlags flags)
static CSysLog * sm_Current
int x_TranslateFacility(EFacility facility)
static const char * kLogName_Syslog
void Post(const SDiagMessage &mess)
Post message to handler.
void HonorRegistrySettings(const IRegistry *reg=0)
@ fNoEndl
No end of line.
@ fNoOverride
never call openlog() ourselves
@ fFallBackToConsole
LOG_CONS.
@ fConnectNow
LOG_NDELAY.
@ fNoChildWait
LOG_NOWAIT.
@ fCopyToStderr
maps to LOG_PERROR if available
@ eDiag_Trace
Trace message.
@ eDiag_Info
Informational message.
@ eDiag_Error
Error message.
@ eDiag_Warning
Warning message.
@ eDiag_Fatal
Fatal error â guarantees exit(or abort)
@ eDiag_Critical
Critical error message.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Warning(CExceptionArgs_Base &args)
virtual const string & Get(const string §ion, const string &name, TFlags flags=0) const
Get the parameter value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
@ eNocase
Case insensitive compare.
Definition of all error codes used in corelib (xncbi.lib).
Process information in the NCBI Registry, including working with configuration files.
DEFINE_CLASS_STATIC_MUTEX(CSysLog::sm_Mutex)
#define LOG_MAKEPRI(facility, priority)
Portable system-logging API.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4