b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * This file and its contents are supplied under the terms of the
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Common Development and Distribution License ("CDDL"), version 1.0.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * You may only use this file in accordance with the terms of version
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * 1.0 of the CDDL.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * A full copy of the text of the CDDL should have accompanied this
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * source. A copy of the CDDL is also available via the Internet at
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross "emerg", "alert", "crit", "err", "warning", "notice", "info", "debug"
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rosssmb_svc_log(int pri, const char *fmt, va_list ap)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross /* NB: cbuf has \n */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross newfmt = smb_syslog_fmt_m(fbuf, sizeof (fbuf), fmt, save_errno);
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross (void) fprintf(stdout, "smbd.%s: ", pri_name[pri]);
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross /* LINTED E_SEC_PRINTF_VAR_FMT */
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Provide a replacement for libsmb:smb_vsyslog() that prints messages
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * both to the normal sysloc(3c), and to stdout, which ends up in:
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * It's much easier to follow debug messages in the service log.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Rosssmb_vsyslog(int pri, const char *fmt, va_list ap)
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * An override for libsmb:smb_trace(). As the comment there says:
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * This function is designed to be used with dtrace, i.e. see:
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * Outside of dtrace, the messages passed to this function usually
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * lack sufficient context to be useful, so don't log them.
b819cea2f73f98c5662230cc9affc8cc84f77fcfGordon Ross * However, if you insist, set debug >= 3 and this will log them.