Changeset 279 for trunk/src/sh_err_syslog.c
- Timestamp:
- Apr 30, 2010, 11:55:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_err_syslog.c
r170 r279 131 131 } 132 132 133 133 static int sh_stamp_priority = LOG_ERR; 134 135 /* set priority for heartbeat messages 136 */ 137 int sh_log_set_stamp_priority (const char * c) 138 { 139 int retval = 0; 140 141 if (0 == strcmp(c, _("LOG_DEBUG"))) { sh_stamp_priority = LOG_DEBUG; } 142 else if (0 == strcmp(c, _("LOG_INFO"))) { sh_stamp_priority = LOG_INFO; } 143 else if (0 == strcmp(c, _("LOG_NOTICE"))) { sh_stamp_priority = LOG_NOTICE;} 144 else if (0 == strcmp(c, _("LOG_WARNING"))) { sh_stamp_priority = LOG_WARNING;} 145 else if (0 == strcmp(c, _("LOG_ERR"))) { sh_stamp_priority = LOG_ERR; } 146 else if (0 == strcmp(c, _("LOG_CRIT"))) { sh_stamp_priority = LOG_CRIT; } 147 else if (0 == strcmp(c, _("LOG_ALERT"))) { sh_stamp_priority = LOG_ALERT; } 148 #ifdef LOG_EMERG 149 else if (0 == strcmp(c, _("LOG_EMERG"))) { sh_stamp_priority = LOG_EMERG; } 150 #endif 151 else { retval = -1; } 152 153 return retval; 154 } 134 155 135 156 /* syslog error message … … 154 175 else if (severity == SH_ERR_NOTICE) priority = LOG_NOTICE; 155 176 else if (severity == SH_ERR_WARN) priority = LOG_WARNING; 156 else if (severity == SH_ERR_STAMP) priority = LOG_ERR;177 else if (severity == SH_ERR_STAMP) priority = sh_stamp_priority; 157 178 else if (severity == SH_ERR_ERR) priority = LOG_ERR; 158 179 else if (severity == SH_ERR_SEVERE) priority = LOG_CRIT;
Note:
See TracChangeset
for help on using the changeset viewer.