⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.23
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
local
/
src
/
netdata
/
src
/
aclk
/
mqtt_websockets
/
View File Name :
mqtt_wss_log.h
// Copyright: SPDX-License-Identifier: GPL-3.0-only #ifndef MQTT_WSS_LOG_H #define MQTT_WSS_LOG_H typedef enum mqtt_wss_log_type { MQTT_WSS_LOG_DEBUG = 0x01, MQTT_WSS_LOG_INFO = 0x02, MQTT_WSS_LOG_WARN = 0x03, MQTT_WSS_LOG_ERROR = 0x81, MQTT_WSS_LOG_FATAL = 0x88 } mqtt_wss_log_type_t; typedef void (*mqtt_wss_log_callback_t)(mqtt_wss_log_type_t, const char*); typedef struct mqtt_wss_log_ctx *mqtt_wss_log_ctx_t; /** Creates logging context with optional prefix and optional callback * @param ctx_prefix String to be prefixed to every log message. * This is useful if multiple clients are instantiated to be able to * know which one this message belongs to. Can be `NULL` for no prefix. * @param log_callback Callback to be called instead of logging to * `STDOUT` or `STDERR` (if debug enabled otherwise silent). Callback has to be * pointer to function of `void function(mqtt_wss_log_type_t, const char*)` type. * If `NULL` default will be used (silent or STDERR/STDOUT). * @return mqtt_wss_log_ctx_t or `NULL` on error */ mqtt_wss_log_ctx_t mqtt_wss_log_ctx_create(const char *ctx_prefix, mqtt_wss_log_callback_t log_callback); /** Destroys logging context and cleans up the memory * @param ctx Context to destroy */ void mqtt_wss_log_ctx_destroy(mqtt_wss_log_ctx_t ctx); void mws_fatal(mqtt_wss_log_ctx_t ctx, const char *fmt, ...); void mws_error(mqtt_wss_log_ctx_t ctx, const char *fmt, ...); void mws_warn (mqtt_wss_log_ctx_t ctx, const char *fmt, ...); void mws_info (mqtt_wss_log_ctx_t ctx, const char *fmt, ...); void mws_debug(mqtt_wss_log_ctx_t ctx, const char *fmt, ...); #endif /* MQTT_WSS_LOG_H */