1/* 2 * Copyright 2007 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel D�rfler 7 * Niels Sascha Reedijk, niels.reedijk@gmail.com 8 * 9 * Corresponds to: 10 * headers/posix/syslog.h rev 6684 11 */ 12 13 14/*! 15 \file syslog.h 16 \ingroup libroot 17 \brief System logging capabilities 18 19 The functions described here are interacting with the syslog_daemon, a server 20 that provides the system logging capabilities. 21 The log can be found in /var/log/syslog. 22*/ 23 24 25/*! 26 \fn void closelog(void) 27 \brief Closes the current log session 28*/ 29 30 31/*! 32 \fn void openlog(const char *ident, int options, int facility) 33 \brief Starts a log session, and sets some output options 34 35 Like openlog_thread() this function defines the log session in thread context; the 36 global options set by openlog_team() are not affected by this function. 37*/ 38 39 40/*! 41 \fn int setlogmask(int priorityMask) 42 \brief sets the logging priority mask 43*/ 44 45 46/*! 47 \fn void syslog(int priority, const char *message, ...) 48 \brief sends a message to the system log 49*/ 50 51 52/*! 53 \fn void closelog_team(void) 54 \brief Closes the log 55*/ 56 57 58/*! 59 \fn void openlog_team(const char *ident, int logopt, int facility) 60 \brief Starts a log session, and sets some output options 61 62 This function defines the team-wide logging options. Thread local sessions 63 started with openlog() or openlog_thread() will inherit the options of the 64 global session. 65*/ 66 67 68/*! 69 \fn void log_team(int priority, const char *message, ...) 70 \brief sends a message to the system log 71*/ 72 73 74/*! 75 \fn int setlogmask_team(int priorityMask) 76 \brief sets the logging priority mask 77*/ 78 79 80/*! 81 \fn void closelog_thread(void) 82 \brief Closes the log 83*/ 84 85 86/*! 87 \fn void openlog_thread(const char *ident, int logopt, int facility) 88 \brief Starts a log session, and sets some output options 89*/ 90 91 92/*! 93 \fn void log_thread(int priority, const char *message, ...) 94 \brief sends a message to the system log 95*/ 96 97 98/*! 99 \fn int setlogmask_thread(int priorityMask) 100 \brief sets the logging priority mask 101*/ 102 103 104/*! 105 \name Options for openlog() 106*/ 107 108 109//! @{ 110 111 112/*! 113 \def LOG_PID 114 \brief Log the process (thread/team) ID with each message 115*/ 116 117 118/*! 119 \def LOG_CONS 120 \brief Log to the system console on error 121*/ 122 123 124/*! 125 \def LOG_ODELAY 126 \brief Delay open until syslog() is called 127*/ 128 129 130/*! 131 \def LOG_NDELAY 132 \brief Connect to the syslog daemon immediately 133*/ 134 135 136/*! 137 \def LOG_SERIAL 138 \brief Dump to serial output as well. 139 \attention This is not yet implemented 140*/ 141 142 143/*! 144 \def LOG_PERROR 145 \brief Dump to stderr as well 146*/ 147 148 149/*! 150 \def LOG_NOWAIT 151 \brief Do not wait for child processes 152*/ 153 154 155//! @} 156 157 158/*! \name Facilities for openlog() 159*/ 160 161 162//! @{ 163 164 165/*! 166 \def LOG_KERN 167 \brief Reserved for messages generated by the kernel. 168*/ 169 170 171/*! 172 \def LOG_USER 173 \brief Reserved for messages generated by user processes. 174*/ 175 176 177/*! 178 \def LOG_MAIL 179 \brief Standard (?) POSIX facility for messages by the mailing daemon. 180*/ 181 182 183/*! 184 \def LOG_DAEMON 185 \brief Standard POSIX (?) facility for messages by daemons (and Haiku servers). 186*/ 187 188 189/*! 190 \def LOG_AUTH 191 \brief Standard POSIX facility(?) for messages by the authentication services. 192*/ 193 194 195/*! 196 \def LOG_SYSLOG 197 \brief Reserved for messages generated by the syslog daemon. 198*/ 199 200 201/*! 202 \def LOG_LPR 203 \brief Reserved for messages generated by the UNIX lpr printing tool. 204*/ 205 206 207/*! 208 \def LOG_NEWS 209 \brief Reserved for messages generated by something UNIXy that does something with NEWS. 210*/ 211 212 213/*! 214 \def LOG_UUCP 215 \brief Reserved for messages generated by UUCP 216*/ 217 218 219/*! 220 \def LOG_CRON 221 \brief Reserved for messages generated by the CRON daemon. 222*/ 223 224 225/*! 226 \def LOG_AUTHPRIV 227 \brief Reserved for private (?) messages that relate to authentication. 228*/ 229 230 231/*! 232 \def LOG_LOCAL0 233 \brief For local use. 234*/ 235 236 237/*! 238 \def LOG_LOCAL1 239 \brief For local use. 240*/ 241 242 243/*! 244 \def LOG_LOCAL2 245 \brief For local use. 246*/ 247 248 249/*! 250 \def LOG_LOCAL3 251 \brief For local use. 252*/ 253 254 255/*! 256 \def LOG_LOCAL4 257 \brief For local use. 258*/ 259 260 261/*! 262 \def LOG_LOCAL5 263 \brief For local use. 264*/ 265 266 267/*! 268 \def LOG_LOCAL6 269 \brief For local use. 270*/ 271 272 273/*! 274 \def LOG_LOCAL7 275 \brief For local use. 276*/ 277 278 279//! @} 280 281 282/*! 283 \name Priorities for syslog(), log_team() and log_thread() 284*/ 285 286 287//! @{ 288 289 290/*! 291 \def LOG_EMERG 292 \brief A panic condition 293*/ 294 295 296/*! 297 \def LOG_PANIC 298 \brief An alias for LOG_EMERG 299*/ 300 301 302/*! 303 \def LOG_ALERT 304 \brief A condition to that should be corrected immediately 305*/ 306 307 308/*! 309 \def LOG_CRIT 310 \brief Critical conditions like hard drive errors 311*/ 312 313 314/*! 315 \def LOG_ERR 316 \brief Errors 317*/ 318 319 320/*! 321 \def LOG_WARNING 322 \brief Warnings 323*/ 324 325 326/*! 327 \def LOG_NOTICE 328 \brief Notices, instructions on how to use certain configuration options. 329*/ 330 331 332/*! 333 \def LOG_INFO 334 \brief Information, like versions and so. 335*/ 336 337 338/*! 339 \def LOG_DEBUG 340 \brief Debug information. 341*/ 342 343 344//! @} 345 346 347/*! 348 \def LOG_MASK 349 \brief Converts a priority definition for use in setlogmask() 350*/ 351