if (!_dbus_string_append_printf_valist (&full_msg, msg, args))
goto oom_out;
- _dbus_system_log (severity, "%s", _dbus_string_get_const_data (&full_msg));
+ _dbus_log (severity, "%s", _dbus_string_get_const_data (&full_msg));
oom_out:
_dbus_string_free (&full_msg);
}
else
- _dbus_system_logv (severity, msg, args);
+ _dbus_logv (severity, msg, args);
out:
va_end (args);
}
else
{
- _dbus_system_log (severity, "%s%s", nonnull (context->log_prefix, ""),
- msg);
+ _dbus_log (severity, "%s%s", nonnull (context->log_prefix, ""), msg);
}
}
* this bus is going to want to write to syslog! (There's
* also some layer inversion going on, if we want to use
* the bus context.) */
- _dbus_system_log (DBUS_SYSTEM_LOG_INFO,
- "Encountered error '%s' while parsing '%s'\n",
- error->message,
- _dbus_string_get_const_data (&full_path));
+ _dbus_log (DBUS_SYSTEM_LOG_INFO,
+ "Encountered error '%s' while parsing '%s'\n",
+ error->message,
+ _dbus_string_get_const_data (&full_path));
dbus_error_free (error);
}
}
* with an error code.
*/
void
-_dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args)
+_dbus_logv (DBusSystemLogSeverity severity,
+ const char *msg,
+ va_list args)
{
va_list tmp;
#ifdef HAVE_SYSLOG_H
* with an error code.
*/
void
-_dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args)
+_dbus_logv (DBusSystemLogSeverity severity,
+ const char *msg,
+ va_list args)
{
char *s = "";
char buf[1024];
* @param msg a printf-style format string
*/
void
-_dbus_system_log (DBusSystemLogSeverity severity, const char *msg, ...)
+_dbus_log (DBusSystemLogSeverity severity,
+ const char *msg,
+ ...)
{
va_list args;
va_start (args, msg);
- _dbus_system_logv (severity, msg, args);
+ _dbus_logv (severity, msg, args);
va_end (args);
}
} DBusSystemLogSeverity;
DBUS_PRIVATE_EXPORT
-void _dbus_system_log (DBusSystemLogSeverity severity, const char *msg, ...) _DBUS_GNUC_PRINTF (2, 3);
+void _dbus_log (DBusSystemLogSeverity severity,
+ const char *msg,
+ ...) _DBUS_GNUC_PRINTF (2, 3);
DBUS_PRIVATE_EXPORT
-void _dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args);
+void _dbus_logv (DBusSystemLogSeverity severity,
+ const char *msg,
+ va_list args);
/* Define DBUS_VA_COPY() to do the right thing for copying va_list variables.
* config.h may have already defined DBUS_VA_COPY as va_copy or __va_copy.
/* hopefully clear enough that people don't think these messages in syslog
* are a bug */
-#define MESSAGE "regression test for _dbus_system_log(): "
+#define MESSAGE "regression test for _dbus_log(): "
static void
test_syslog (Fixture *f,
if (g_test_trap_fork (0, 0))
{
_dbus_init_system_log ("test-syslog", FALSE);
- _dbus_system_log (DBUS_SYSTEM_LOG_FATAL, MESSAGE "%d", 23);
+ _dbus_log (DBUS_SYSTEM_LOG_FATAL, MESSAGE "%d", 23);
/* should not be reached: exit 0 so the assertion in the main process
* will fail */
exit (0);
if (g_test_trap_fork (0, 0))
{
_dbus_init_system_log ("test-syslog", FALSE);
- _dbus_system_log (DBUS_SYSTEM_LOG_INFO, MESSAGE "%d", 42);
- _dbus_system_log (DBUS_SYSTEM_LOG_WARNING, MESSAGE "%d", 45);
- _dbus_system_log (DBUS_SYSTEM_LOG_SECURITY, MESSAGE "%d", 666);
+ _dbus_log (DBUS_SYSTEM_LOG_INFO, MESSAGE "%d", 42);
+ _dbus_log (DBUS_SYSTEM_LOG_WARNING, MESSAGE "%d", 45);
+ _dbus_log (DBUS_SYSTEM_LOG_SECURITY, MESSAGE "%d", 666);
exit (0);
}
#endif
/* manual test (this is the best we can do on Windows) */
_dbus_init_system_log ("test-syslog", FALSE);
- _dbus_system_log (DBUS_SYSTEM_LOG_INFO, MESSAGE "%d", 42);
- _dbus_system_log (DBUS_SYSTEM_LOG_WARNING, MESSAGE "%d", 45);
- _dbus_system_log (DBUS_SYSTEM_LOG_SECURITY, MESSAGE "%d", 666);
+ _dbus_log (DBUS_SYSTEM_LOG_INFO, MESSAGE "%d", 42);
+ _dbus_log (DBUS_SYSTEM_LOG_WARNING, MESSAGE "%d", 45);
+ _dbus_log (DBUS_SYSTEM_LOG_SECURITY, MESSAGE "%d", 666);
}
static void