libGumball 0.0.1
C23-Based, libGimbal-powered UI Library
Loading...
Searching...
No Matches
gumball_logger.h
Go to the documentation of this file.
1#ifndef GUM_LOGGER_H
2#define GUM_LOGGER_H
3
4// View this file's documentation online: https://libgumball.psyops.studio/gumball__logger_8h.html
5
6/*! \file
7 * \brief Gumball logger
8 * \ingroup core
9 *
10 * Simple wrappers around GBL_LOG_* for convenience
11 * All logs are prefixed with "gumball" as their domain.
12 *
13 * \author 2025 Agustín Bellagamba
14 * \copyright MIT License
15*/
16
17#include <gimbal/core/gimbal_logger.h>
18
19#define GUM_LOG_VERBOSE(...) GBL_LOG_VERBOSE("gumball", __VA_ARGS__) //!< Logs with GBL_LOG_VERBOSE
20#define GUM_LOG_DEBUG(...) GBL_LOG_DEBUG("gumball", __VA_ARGS__) //!< Logs with GBL_LOG_DEBUG
21#define GUM_LOG_INFO(...) GBL_LOG_INFO("gumball", __VA_ARGS__) //!< Logs with GBL_LOG_INFO
22#define GUM_LOG_WARN(...) GBL_LOG_WARN("gumball", __VA_ARGS__) //!< Logs with GBL_LOG_WARN
23#define GUM_LOG_ERROR(...) GBL_LOG_ERROR("gumball", __VA_ARGS__) //!< Logs with GBL_LOG_ERROR
24#define GUM_LOG_PUSH() GBL_LOG_PUSH()
25#define GUM_LOG_POP(n) GBL_LOG_POP(n)
26
27#define GUM_LOG_VERBOSE_PUSH(...) GBL_LOG_VERBOSE_PUSH("gumball", __VA_ARGS__) //!< Pushes a level to the log stack, then logs with GBL_LOG_VERBOSE
28#define GUM_LOG_DEBUG_PUSH(...) GBL_LOG_DEBUG_PUSH("gumball", __VA_ARGS__) //!< Pushes a level to the log stack, then logs with GBL_LOG_DEBUG
29#define GUM_LOG_INFO_PUSH(...) GBL_LOG_INFO_PUSH("gumball", __VA_ARGS__) //!< Pushes a level to the log stack, then logs with GBL_LOG_INFO
30#define GUM_LOG_WARN_PUSH(...) GBL_LOG_WARN_PUSH("gumball", __VA_ARGS__) //!< Pushes a level to the log stack, then logs with GBL_LOG_WARN
31#define GUM_LOG_ERROR_PUSH(...) GBL_LOG_ERROR_PUSH("gumball", __VA_ARGS__) //!< Pushes a level to the log stack, then logs with GBL_LOG_ERROR
32
33
34#define GUM_LOG_VERBOSE_SCOPE(...) GBL_LOG_VERBOSE_SCOPE("gumball", __VA_ARGS__) //!< Logs with GBL_LOG_VERBOSE, then pushes a level to the log stack. Pops level when scope ends
35#define GUM_LOG_DEBUG_SCOPE(...) GBL_LOG_DEBUG_SCOPE("gumball", __VA_ARGS__) //!< Logs with GBL_LOG_DEBUG, then pushes a level to the log stack. Pops level when scope ends
36#define GUM_LOG_INFO_SCOPE(...) GBL_LOG_INFO_SCOPE("gumball", __VA_ARGS__) //!< Logs with GBL_LOG_INFO, then pushes a level to the log stack. Pops level when scope ends
37#define GUM_LOG_WARN_SCOPE(...) GBL_LOG_WARN_SCOPE("gumball", __VA_ARGS__) //!< Logs with GBL_LOG_WARN, then pushes a level to the log stack. Pops level when scope ends
38#define GUM_LOG_ERROR_SCOPE(...) GBL_LOG_ERROR_SCOPE("gumball", __VA_ARGS__) //!< Logs with GBL_LOG_ERROR, then pushes a level to the log stack. Pops level when scope ends
39
40#endif // GUM_LOGGER_H