Files
cubelinux-kernel/tools/thermal/lib/log.h
T
Greg Kroah-Hartman 598cf27219 Linux 6.19.3
Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com>
Tested-by: Peter Schneider <pschneider1968@googlemail.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
Tested-by: Brett A C Sheffield <bacs@librecast.net>
Tested-by: Mark Brown <broonie@kernel.org>
Tested-by: Luna Jernberg <droidbittin@gmail.com>
Tested-by: Ronald Warsow <rwarsow@gmx.de>
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Tested-by: Ron Economos <re@w6rz.net>
Tested-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-19 16:33:27 +01:00

32 lines
1.0 KiB
C

/* SPDX-License-Identifier: LGPL-2.1+ */
/* Copyright (C) 2022, Linaro Ltd - Daniel Lezcano <daniel.lezcano@linaro.org> */
#ifndef __THERMAL_TOOLS_LOG_H
#define __THERMAL_TOOLS_LOG_H
#include <syslog.h>
#ifndef __maybe_unused
#define __maybe_unused __attribute__((__unused__))
#endif
#define TO_SYSLOG 0x1
#define TO_STDOUT 0x2
#define TO_STDERR 0x4
extern void logit(int level, const char *format, ...);
#define DEBUG(fmt, ...) logit(LOG_DEBUG, "%s:%d: " fmt, __func__, __LINE__, ##__VA_ARGS__)
#define INFO(fmt, ...) logit(LOG_INFO, fmt, ##__VA_ARGS__)
#define NOTICE(fmt, ...) logit(LOG_NOTICE, fmt, ##__VA_ARGS__)
#define WARN(fmt, ...) logit(LOG_WARNING, fmt, ##__VA_ARGS__)
#define ERROR(fmt, ...) logit(LOG_ERR, fmt, ##__VA_ARGS__)
#define CRITICAL(fmt, ...) logit(LOG_CRIT, fmt, ##__VA_ARGS__)
#define ALERT(fmt, ...) logit(LOG_ALERT, fmt, ##__VA_ARGS__)
#define EMERG(fmt, ...) logit(LOG_EMERG, fmt, ##__VA_ARGS__)
int log_init(int level, const char *ident, int options);
int log_str2level(const char *lvl);
void log_exit(void);
#endif