26#ifndef _ULTIBO_LOGGING_H
27#define _ULTIBO_LOGGING_H
39#define LOGGING_NAME_PREFIX "Logging"
41#define LOGGING_THREAD_NAME "Logging"
42#define LOGGING_THREAD_PRIORITY THREAD_PRIORITY_NORMAL
45#define LOGGING_TYPE_NONE 0
46#define LOGGING_TYPE_CONSOLE 1
47#define LOGGING_TYPE_FILE 2
48#define LOGGING_TYPE_SYSLOG 3
49#define LOGGING_TYPE_SERIAL 4
52#define LOGGING_STATE_DISABLED 0
53#define LOGGING_STATE_ENABLED 1
56#define LOGGING_FLAG_NONE 0x00000000
59#define CONSOLE_LOGGING_DESCRIPTION "Console Logging"
struct _CONSOLE_DEVICE CONSOLE_DEVICE
Definition console.h:186
struct _DEVICE DEVICE
Definition devices.h:373
int32_t LONGBOOL
Compatibility with FPC LongBool type (4 bytes).
Definition globaltypes.h:56
size_t HANDLE
Definition globaltypes.h:51
#define STDCALL
Definition globaltypes.h:45
_Bool BOOL
Built in Boolean type (1 byte) (Redeclared here for flexibility).
Definition globaltypes.h:55
HANDLE MUTEX_HANDLE
Definition globaltypes.h:105
uint32_t STDCALL(* logging_device_start_proc)(LOGGING_DEVICE *logging)
Definition logging.h:88
uint32_t STDCALL logging_console_device_remove(CONSOLE_DEVICE *console)
uint32_t STDCALL logging_device_enumerate(logging_enumerate_cb callback, void *data)
uint32_t STDCALL logging_device_destroy(LOGGING_DEVICE *logging)
Destroy an existing Logging device entry.
uint32_t STDCALL logging_device_output(LOGGING_DEVICE *logging, const char *data)
uint32_t STDCALL logging_device_output_ex(LOGGING_DEVICE *logging, uint32_t facility, uint32_t severity, const char *tag, const char *content)
LOGGING_DEVICE *STDCALL logging_device_get_default(void)
Get the current default logging device.
uint32_t STDCALL logging_device_set_default(LOGGING_DEVICE *logging)
Set the current default logging device.
uint32_t STDCALL logging_device_stop(LOGGING_DEVICE *logging)
uint32_t STDCALL logging_type_to_string(uint32_t loggingtype, char *string, uint32_t len)
Convert a Logging type value to a string.
uint32_t STDCALL logging_console_device_add(CONSOLE_DEVICE *console)
int STDCALL logging_device_outputf(LOGGING_DEVICE *logging, const char *format,...) _ATTRIBUTE((__format__(__printf__
Output formatted text to a Logging device.
uint32_t STDCALL logging_device_register(LOGGING_DEVICE *logging)
Register a new Logging device in the Logging table.
struct _LOGGING_ENTRY LOGGING_ENTRY
Definition logging.h:62
uint32_t STDCALL(* logging_device_output_ex_proc)(LOGGING_DEVICE *logging, uint32_t facility, uint32_t severity, const char *tag, const char *content)
Syslog compatible output.
Definition logging.h:91
LOGGING_DEVICE *STDCALL logging_device_create(BOOL _default)
Create a new Logging device entry.
struct _LOGGING_ENTRY_EX LOGGING_ENTRY_EX
Definition logging.h:71
LOGGING_DEVICE *STDCALL logging_device_find_by_name(const char *name)
BOOL STDCALL logging_device_redirect_output(LOGGING_DEVICE *logging)
Redirect standard output to the logging device specified by Logging.
uint32_t STDCALL logging_device_start(LOGGING_DEVICE *logging)
LOGGING_DEVICE *STDCALL logging_device_create_ex(uint32_t size, BOOL _default)
Create a new Logging device entry.
uint32_t STDCALL logging_get_messageslot_flags(void)
Get the lock flags for the logging messageslot.
uint32_t STDCALL logging_state_to_string(uint32_t loggingstate, char *string, uint32_t len)
Convert a Logging state value to a string.
char *STDCALL(* logging_device_get_target_proc)(LOGGING_DEVICE *logging)
Definition logging.h:92
int STDCALL uint32_t STDCALL logging_device_get_count(void)
Get the current logging device count.
uint32_t STDCALL(* logging_notification_cb)(DEVICE *device, void *data, uint32_t notification)
Definition logging.h:85
LOGGING_DEVICE *STDCALL logging_device_find_by_type(uint32_t loggingtype)
uint32_t STDCALL logging_device_get_target(LOGGING_DEVICE *logging, char *target, uint32_t len)
uint32_t STDCALL logging_device_notification(LOGGING_DEVICE *logging, logging_notification_cb callback, void *data, uint32_t notification, uint32_t flags)
uint32_t STDCALL(* logging_device_stop_proc)(LOGGING_DEVICE *logging)
Definition logging.h:89
struct _LOGGING_DEVICE LOGGING_DEVICE
Definition logging.h:80
LOGGING_DEVICE *STDCALL logging_device_find_by_device(DEVICE *device)
uint32_t STDCALL logging_device_set_target(LOGGING_DEVICE *logging, const char *target)
LOGGING_DEVICE *STDCALL logging_device_find_by_description(const char *description)
LOGGING_DEVICE *STDCALL logging_device_check(LOGGING_DEVICE *logging)
Check if the supplied Logging device is in the Logging table.
uint32_t STDCALL(* logging_enumerate_cb)(LOGGING_DEVICE *logging, void *data)
Definition logging.h:83
LOGGING_DEVICE *STDCALL logging_device_find(uint32_t loggingid)
uint32_t STDCALL(* logging_device_output_proc)(LOGGING_DEVICE *logging, const char *data)
Definition logging.h:90
uint32_t STDCALL logging_device_deregister(LOGGING_DEVICE *logging)
Deregister a Logging device from the Logging table.
uint32_t STDCALL(* logging_device_set_target_proc)(LOGGING_DEVICE *logging, const char *target)
Definition logging.h:93
HANDLE handle
Device output handle.
Definition logging.h:113
MUTEX_HANDLE lock
Device lock.
Definition logging.h:112
logging_device_output_proc deviceoutput
A device specific DeviceOutput method implementing a standard logging device interface.
Definition logging.h:105
char * target
Device output target.
Definition logging.h:114
LONGBOOL _default
Device can be the default logging device.
Definition logging.h:115
DEVICE device
The Device entry for this Logging device.
Definition logging.h:99
logging_device_get_target_proc devicegettarget
A device specific DeviceGetTarget method implementing a standard logging device interface (Or nil if ...
Definition logging.h:107
logging_device_output_ex_proc deviceoutputex
A device specific DeviceOutputEx method implementing a standard logging device interface.
Definition logging.h:106
logging_device_set_target_proc devicesettarget
A device specific DeviceSetTarget method implementing a standard logging device interface (Or nil if ...
Definition logging.h:108
LOGGING_DEVICE * prev
Previous entry in Logging device table.
Definition logging.h:117
logging_device_start_proc devicestart
A device specific DeviceStart method implementing a standard logging device interface (Or nil if the ...
Definition logging.h:103
uint32_t outputcount
Definition logging.h:110
logging_device_stop_proc devicestop
A device specific DeviceStop method implementing a standard logging device interface (Or nil if the d...
Definition logging.h:104
LOGGING_DEVICE * next
Next entry in Logging device table.
Definition logging.h:118
uint32_t loggingid
Unique Id of this Logging device in the Logging device table.
Definition logging.h:101
uint32_t loggingstate
Logging device state (eg LOGGING_STATE_ENABLED).
Definition logging.h:102
ssize_t severity
TMessage.lParam:PtrInt.
Definition logging.h:76
uint32_t facility
TMessage.Time:LongWord.
Definition logging.h:77
char * tag
TMessage.wParam:PtrUInt.
Definition logging.h:75
char * content
TMessage.Msg:PtrUInt.
Definition logging.h:74
ssize_t reserved2
TMessage.lParam:PtrInt.
Definition logging.h:67
size_t reserved1
TMessage.wParam:PtrUInt.
Definition logging.h:66
uint32_t reserved3
TMessage.Time:LongWord.
Definition logging.h:68
char * data
TMessage.Msg:PtrUInt.
Definition logging.h:65