CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
logdefer.h
Go to the documentation of this file.
1#pragma once
4
35
36#include <cx/log/log.h>
37
39typedef struct LogDeferData LogDeferData;
40
41// ============================================================================
42// High Level Interface
43// ============================================================================
44
55_Ret_valid_ LogDeferData* logDeferCreate(void);
56
72LogDest* logDeferRegister(int level, _In_opt_ LogCategory* catfilter, _In_ LogDeferData* deferdata);
73
74// ============================================================================
75// Low Level Interface
76// ============================================================================
77//
78// These functions are typically used through the high-level wrappers above
79// or through destination-specific "WithDefer" registration functions.
80
92void logDeferDest(int level, _In_opt_ LogCategory* cat, int64 timestamp, _In_opt_ strref msg,
93 uint32 batchid, _In_opt_ void* userdata);
94
121_Ret_opt_valid_ LogDest*
122logRegisterDestWithDefer(int maxlevel, _In_opt_ LogCategory* catfilter, _In_ LogDestMsg msgfunc,
123 _In_opt_ LogDestBatchDone batchfunc, _In_opt_ LogDestClose closefunc,
124 _In_opt_ void* userdata, _In_opt_ _Post_invalid_ LogDest* deferdest);
125
127
struct LogDest LogDest
Opaque handle to a registered log destination.
Definition log.h:87
void(* LogDestMsg)(int level, LogCategory *cat, int64 timestamp, strref msg, uint32 batchid, void *userdata)
Definition log.h:120
void(* LogDestBatchDone)(uint32 batchid, void *userdata)
Definition log.h:130
void(* LogDestClose)(void *userdata)
Definition log.h:138
LogDest * logDeferRegister(int level, LogCategory *catfilter, LogDeferData *deferdata)
LogDest * logRegisterDestWithDefer(int maxlevel, LogCategory *catfilter, LogDestMsg msgfunc, LogDestBatchDone batchfunc, LogDestClose closefunc, void *userdata, LogDest *deferdest)
void logDeferDest(int level, LogCategory *cat, int64 timestamp, strref msg, uint32 batchid, void *userdata)
LogDeferData * logDeferCreate(void)
Core logging system API.