CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
logconsole.h
Go to the documentation of this file.
1#pragma once
4
40
41#include <cx/console/console.h>
42#include <cx/console/constyle.h>
43#include <cx/log/log.h>
45
46CX_C_BEGIN
47
55
72
75
76// ============================================================================
77// High Level Interface
78// ============================================================================
79
103LogDest* logconsoleRegister(int maxlevel, _In_opt_ strref chanfilter, _In_opt_ ConStream* out,
104 _In_opt_ ConStream* err, _In_ const LogConsoleConfig* config,
105 _In_opt_ LogSerializer* ser);
106
107// ============================================================================
108// Low Level Interface
109// ============================================================================
110//
111// These callbacks can be used directly with logRegisterDest() for custom
112// destination handling. Most users should use the high-level interface above.
113
134_Ret_valid_ LogConsoleData* logconsoleCreate(_In_opt_ ConStream* out, _In_opt_ ConStream* err,
135 _In_ const LogConsoleConfig* config,
136 _In_opt_ LogSerializer* ser);
137
145void logconsoleMsgFunc(_In_ const LogRecord* rec, _In_opt_ void* userdata);
146
153void logconsoleBatchFunc(uint32 batchid, _In_opt_ void* userdata);
154
161void logconsoleCloseFunc(_In_opt_ void* userdata);
162
164
165CX_C_END
Console streams, capability detection, and buffered output.
Console text styling: colors, attributes, and styled writes.
void logconsoleCloseFunc(void *userdata)
LogDest * logconsoleRegister(int maxlevel, strref chanfilter, ConStream *out, ConStream *err, const LogConsoleConfig *config, LogSerializer *ser)
struct LogConsoleData LogConsoleData
Opaque handle for console logging state.
Definition logconsole.h:74
LOGCON_COLOR_MODE
Color decision for a console destination.
Definition logconsole.h:49
void logconsoleMsgFunc(const LogRecord *rec, void *userdata)
void logconsoleBatchFunc(uint32 batchid, void *userdata)
LogConsoleData * logconsoleCreate(ConStream *out, ConStream *err, const LogConsoleConfig *config, LogSerializer *ser)
@ LOGCON_ColorOff
Never apply style; plain text only.
Definition logconsole.h:53
@ LOGCON_ColorAuto
Style only when the destination stream reports color support.
Definition logconsole.h:50
@ LOGCON_ColorOn
Definition logconsole.h:51
struct LogDest LogDest
Opaque handle to a registered log destination.
Definition log.h:187
Core logging system API.
Log record serializers, independent of where the result is written.
ConStyle levelStyle[LOG_Count]
Definition logconsole.h:70
int colorMode
A LOGCON_COLOR_MODE value.
Definition logconsole.h:66
A record serializer, owned by whichever transport it was handed to.