blob: cf21eb617699cc476b41f5258dccebcf4513ce93 [file] [log] [blame]
chen.wang19fec1842023-06-15 06:52:30 +00001#ifndef LIBDRM_MESON_LOG_H_
2#define LIBDRM_MESON_LOG_H_
3#if defined(__cplusplus)
4extern "C" {
5#endif
6
7#include <stdio.h>
8#include <stdint.h>
9#include <stdlib.h>
10#include <unistd.h>
11
12void mesonDrmLog( int level, const char *fmt, ... );
chen.wang1e6ac8df2023-09-12 06:07:18 +000013void mesonDrmEdidLog( int level, const char *fmt, ... );
chen.wang19fec1842023-06-15 06:52:30 +000014long long getMonotonicTimeMicros( void );
15
chen.wang1e6ac8df2023-09-12 06:07:18 +000016#define INT_ERROR(FORMAT, ...) mesonDrmLog(0, "ERROR: " FORMAT "\n", __VA_ARGS__)
17#define INT_INFO(FORMAT, ...) mesonDrmLog(1, "INFO: " FORMAT "\n", __VA_ARGS__)
18#define INT_DEBUG(FORMAT, ...) mesonDrmLog(2, "DEBUG: " FORMAT "\n", __VA_ARGS__)
19#define INT_DEBUG_DEID(FORMAT, ...) mesonDrmEdidLog(2, FORMAT , __VA_ARGS__)
chen.wang19fec1842023-06-15 06:52:30 +000020
21#define ERROR(...) INT_ERROR(__VA_ARGS__, "")
22#define INFO(...) INT_INFO(__VA_ARGS__, "")
23#define DEBUG(...) INT_DEBUG(__VA_ARGS__, "")
chen.wang1e6ac8df2023-09-12 06:07:18 +000024#define DEBUG_EDID(...) INT_DEBUG_DEID(__VA_ARGS__, "")
chen.wang19fec1842023-06-15 06:52:30 +000025
26#if defined(__cplusplus)
27}
28#endif
29
30#endif