mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2024-11-16 15:06:05 +00:00
8af2563859
This helps provider better logs. With this, the user can now run with `-v` for verbose logs, use more `-v` to be more verbose, eg `calls -vvvvv` log shall be very verbose
39 lines
1.6 KiB
C
39 lines
1.6 KiB
C
/* -*- mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*- */
|
|
/* calls-log.c
|
|
*
|
|
* Copyright 2021 Purism SPC
|
|
*
|
|
* Author(s):
|
|
* Mohammed Sadiq <sadiq@sadiqpk.org>
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#ifndef CALLS_LOG_LEVEL_TRACE
|
|
# define CALLS_LOG_LEVEL_TRACE ((GLogLevelFlags)(1 << G_LOG_LEVEL_USER_SHIFT))
|
|
# define CALLS_LOG_DETAILED ((GLogLevelFlags)(8 << G_LOG_LEVEL_USER_SHIFT))
|
|
#endif
|
|
|
|
/* XXX: Should we use the semi-private g_log_structured_standard() API? */
|
|
#define CALLS_TRACE_MSG(...) \
|
|
g_log_structured_standard (G_LOG_DOMAIN, CALLS_LOG_LEVEL_TRACE, \
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
G_STRFUNC, __VA_ARGS__)
|
|
|
|
|
|
#define CALLS_TRACE(...) \
|
|
g_log_structured_standard (G_LOG_DOMAIN, \
|
|
CALLS_LOG_LEVEL_TRACE | CALLS_LOG_DETAILED, \
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
G_STRFUNC, __VA_ARGS__)
|
|
#define CALLS_DEBUG(...) \
|
|
g_log_structured_standard (G_LOG_DOMAIN, \
|
|
G_LOG_LEVEL_DEBUG | CALLS_LOG_DETAILED, \
|
|
__FILE__, G_STRINGIFY (__LINE__), \
|
|
G_STRFUNC, __VA_ARGS__)
|
|
|
|
void calls_log_init (void);
|
|
void calls_log_increase_verbosity (void);
|
|
int calls_log_get_verbosity (void);
|