diff options
author | Jeremy Allison <jra@samba.org> | 2002-03-27 23:17:50 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-03-27 23:17:50 +0000 |
commit | 0cb0c6e90348c9e85e38b65778b93a78af7462a5 (patch) | |
tree | f24d6612b27f70ccb9794a2a56d27a43c8899a3e /source3/lib | |
parent | a2819db2f0a2b09f1d518ba7459dade3d5363de3 (diff) | |
download | samba-0cb0c6e90348c9e85e38b65778b93a78af7462a5.tar.gz samba-0cb0c6e90348c9e85e38b65778b93a78af7462a5.tar.bz2 samba-0cb0c6e90348c9e85e38b65778b93a78af7462a5.zip |
Added sys_adminlog() system for info the appliance admins really
need to know about. Different from the DEBUG system.
Jeremy.
(This used to be commit 74eac41c681f92a6da0ae2167f031e021862e0d8)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/system.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c index 2a0889b356..8c7eec939e 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -1204,3 +1204,31 @@ const char *sys_dlerror(void) return NULL; #endif } + +/************************************************************************** + Wrapper for Admin Logs. +****************************************************************************/ + +void sys_adminlog(int priority, const char *format_str, ...) +{ + va_list ap; + int ret; + char **msgbuf = NULL; + + if (!lp_admin_log()) + return; + + va_start( ap, format_str ); + ret = vasprintf( msgbuf, format_str, ap ); + va_end( ap ); + + if (ret == -1) + return; + +#if defined(HAVE_SYSLOG) + syslog( priority, "%s", *msgbuf ); +#else + DEBUG(0,("%s", *msgbuf )); +#endif + SAFE_FREE(*msgbuf); +} |