summaryrefslogtreecommitdiff
path: root/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'log.c')
-rw-r--r--log.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/log.c b/log.c
index fae5b043f..4a8239b93 100644
--- a/log.c
+++ b/log.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: log.c,v 1.40 2007/05/17 07:50:31 djm Exp $ */ 1/* $OpenBSD: log.c,v 1.41 2008/06/10 04:50:25 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -114,6 +114,17 @@ log_facility_number(char *name)
114 return SYSLOG_FACILITY_NOT_SET; 114 return SYSLOG_FACILITY_NOT_SET;
115} 115}
116 116
117const char *
118log_facility_name(SyslogFacility facility)
119{
120 u_int i;
121
122 for (i = 0; log_facilities[i].name; i++)
123 if (log_facilities[i].val == facility)
124 return log_facilities[i].name;
125 return NULL;
126}
127
117LogLevel 128LogLevel
118log_level_number(char *name) 129log_level_number(char *name)
119{ 130{
@@ -126,6 +137,17 @@ log_level_number(char *name)
126 return SYSLOG_LEVEL_NOT_SET; 137 return SYSLOG_LEVEL_NOT_SET;
127} 138}
128 139
140const char *
141log_level_name(LogLevel level)
142{
143 u_int i;
144
145 for (i = 0; log_levels[i].name != NULL; i++)
146 if (log_levels[i].val == level)
147 return log_levels[i].name;
148 return NULL;
149}
150
129/* Error messages that should be logged. */ 151/* Error messages that should be logged. */
130 152
131void 153void