1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-14 00:17:35 +00:00
Purism-Calls/src/calls-log.h
Mohammed Sadiq 8af2563859 Add and use new logger
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
2021-08-11 09:38:19 +00:00

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);