gonzui


Format: Advanced Search

tkernel_2/include/sys/syslog.hbare sourcepermlink (0.01 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    T-Kernel 2.0 Software Package
    4:  *
    5:  *    Copyright 2011 by Ken Sakamura.
    6:  *    This software is distributed under the latest version of T-License 2.x.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17.
   10:  *    Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
   11:  *
   12:  *----------------------------------------------------------------------
   13:  */
   14: 
   15: /*
   16:  *      @(#)syslog.h (sys)
   17:  *
   18:  *      System log output library
   19:  *
   20:  *      The system log is displayed on the debugging console.
   21:  */
   22: 
   23: #ifndef __SYS_SYSLOG_H__
   24: #define __SYS_SYSLOG_H__
   25: 
   26: #include <basic.h>
   27: 
   28: #ifdef __cplusplus
   29: extern "C" {
   30: #endif
   31: 
   32: /*
   33:  * Level
   34:  */
   35: #define LOG_EMERG       0             /* System down */
   36: #define LOG_ALERT       1             /* Error -
   37:                                            immediate termination required */
   38: #define LOG_CRIT        2              /* Error -
   39:                                            due to failure */
   40: #define LOG_ERR         3              /* Other error */
   41: #define LOG_WARNING     4           /* Caution */
   42: #define LOG_NOTICE      5            /* Reference information */
   43: #define LOG_INFO        6              /* General information */
   44: #define LOG_DEBUG       7             /* Debugging information */
   45: 
   46: #define LOG_PRIMASK     0x0007U             /* Level mask value */
   47: 
   48: /*
   49:  * Facility
   50:  */
   51: #define LOG_OTHER       (0 << 3)      /* Other */
   52: #define LOG_KERN        (1 << 3)       /* Kernel */
   53: #define LOG_SUBSYS      (2 << 3)     /* Subsystem */
   54: #define LOG_DEVDRV      (3 << 3)     /* Device driver */
   55: 
   56: #define LOG_NFACILITIES 16              /* Facility number */
   57: #define LOG_FACMASK     0x0078U             /* Facility mask value */
   58: 
   59: /*
   60:  * Generate system log mask value
   61:  */
   62: #define LOG_MASK(level)         ( 1 << (level) )
   63: #define LOG_UPTO(level)         ( (1 << ((level) + 1)) - 1 )
   64: 
   65: /*
   66:  * priority = level | facility
   67:  */
   68: extern void syslog( int priority, const char *format, ... );
   69: extern int setlogmask( int mask );
   70: 
   71: extern int _syslog_send( const char *string, int len ); /* T-Kernel/SM */
   72: Inline void syslog_wait( void )
   73: {
   74:         _syslog_send((const char*)0, 0);
   75: }
   76: 
   77: #ifdef __cplusplus
   78: }
   79: #endif
   80: #endif /* __SYS_SYSLOG_H__ */