aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/verror_msg.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c
index 22c30357b..6d3459905 100644
--- a/libbb/verror_msg.c
+++ b/libbb/verror_msg.c
@@ -12,7 +12,7 @@
12#endif 12#endif
13 13
14#if ENABLE_FEATURE_SYSLOG 14#if ENABLE_FEATURE_SYSLOG
15smallint syslog_level = LOG_ERR; 15static smallint syslog_level = LOG_ERR;
16#endif 16#endif
17smallint logmode = LOGMODE_STDIO; 17smallint logmode = LOGMODE_STDIO;
18const char *msg_eol = "\n"; 18const char *msg_eol = "\n";
@@ -154,7 +154,7 @@ void FAST_FUNC bb_verror_msg(const char *s, va_list p, const char* strerr)
154 } 154 }
155# if ENABLE_FEATURE_SYSLOG 155# if ENABLE_FEATURE_SYSLOG
156 if (logmode & LOGMODE_SYSLOG) { 156 if (logmode & LOGMODE_SYSLOG) {
157 syslog(LOG_ERR, "%s", msgc); 157 syslog(syslog_level, "%s", msgc);
158 } 158 }
159# endif 159# endif
160 free(msgc); 160 free(msgc);
@@ -180,3 +180,21 @@ void FAST_FUNC bb_error_msg(const char *s, ...)
180 bb_verror_msg(s, p, NULL); 180 bb_verror_msg(s, p, NULL);
181 va_end(p); 181 va_end(p);
182} 182}
183
184#if ENABLE_FEATURE_SYSLOG_INFO
185void FAST_FUNC bb_vinfo_msg(const char *s, va_list p)
186{
187 syslog_level = LOG_INFO;
188 bb_verror_msg(s, p, NULL);
189 syslog_level = LOG_ERR;
190}
191
192void FAST_FUNC bb_info_msg(const char *s, ...)
193{
194 va_list p;
195
196 va_start(p, s);
197 bb_vinfo_msg(s, p);
198 va_end(p);
199}
200#endif