debug: Use backends instead of explicitly logging to syslog or file
authorChristof Schmitt <cs@samba.org>
Fri, 9 Jan 2015 21:56:38 +0000 (14:56 -0700)
committerChristof Schmitt <cs@samba.org>
Mon, 23 Mar 2015 20:22:11 +0000 (21:22 +0100)
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
lib/util/debug.c

index 1d8bf811de270bb9e80c804171e566e5415f9b52..806138a05627dbefe02ac2bd4e1ce9c1b039cba5 100644 (file)
@@ -1036,30 +1036,7 @@ static int Debug1(const char *msg)
                goto done;
        }
 
-#ifdef WITH_SYSLOG
-       if( current_msg_level < state.settings.syslog ) {
-               int priority = debug_level_to_priority(current_msg_level);
-
-               /*
-                * Specify the facility to interoperate with other syslog
-                * callers (vfs_full_audit for example).
-                */
-               priority |= SYSLOG_FACILITY;
-
-               syslog(priority, "%s", msg);
-       }
-#endif
-
-       check_log_size();
-
-#ifdef WITH_SYSLOG
-       if( !state.settings.syslog_only)
-#endif
-       {
-               if (state.fd > 0) {
-                       write(state.fd, msg, strlen(msg));
-               }
-       }
+       debug_backends_log(msg, current_msg_level);
 
  done:
        errno = old_errno;