CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
logserializer.h File Reference

Log record serializers, independent of where the result is written. More...

#include <cx/log/log.h>

Go to the source code of this file.

Data Structures

struct  LogSerializer
 A record serializer, owned by whichever transport it was handed to. More...
 
struct  LogTextConfig
 
struct  LogNdjsonConfig
 Configuration for the NDJSON serializer. More...
 

Typedefs

typedef void(* LogSerializeFunc) (string *out, const LogRecord *rec, void *userdata)
 
typedef void(* LogSerializerClose) (void *userdata)
 Releases a serializer's private context.
 
typedef struct LogSerializer LogSerializer
 A record serializer, owned by whichever transport it was handed to.
 
typedef struct LogTextConfig LogTextConfig
 
typedef struct LogNdjsonConfig LogNdjsonConfig
 Configuration for the NDJSON serializer.
 

Enumerations

enum  LOG_DATE_FORMATS {
  LOG_DateISO , LOG_DateISOCompact , LOG_DateNCSA , LOG_DateSyslog ,
  LOG_DateISOCompactMsec , LOG_DateTimeOnly , LOG_DateTimeOnlyMsec
}
 Timestamp format options for log output. More...
 
enum  LOG_FLAGS {
  LOG_LocalTime = 0x0001 , LOG_OmitLevel = 0x0002 , LOG_ShortLevel = 0x0004 , LOG_BracketLevel = 0x0008 ,
  LOG_JustifyLevel = 0x0010 , LOG_IncludeChannel = 0x0020 , LOG_BracketChannel = 0x0040 , LOG_AddColon = 0x0080 ,
  LOG_ChannelFirst = 0x0100 , LOG_IncludeContext = 0x0200 , LOG_OmitDate = 0x0400
}
 Formatting flags for text log output. More...
 

Functions

LogSerializerlogSerializerCreate (LogSerializeFunc serialize, LogSerializerClose close, void *userdata)
 
void logSerializerDestroy (LogSerializer **ser)
 
void logSerialize (string *out, LogSerializer *ser, const LogRecord *rec)
 
LogSerializerlogTextSerializer (LogTextConfig *config)
 
LogSerializerlogNdjsonSerializer (LogNdjsonConfig *config)
 
void logVarText (string *out, const stvar *v)
 
void logFormatDate (string *out, int dateFormat, uint32 flags, int64 timestamp)
 
void logFormatLevel (string *out, int level, uint32 flags)
 
void logFormatChannel (string *out, LogChannel *chan, uint32 flags)
 

Detailed Description

Log record serializers, independent of where the result is written.

Definition in file logserializer.h.