diff options
| author | andreas | 2026-06-27 17:42:30 +0200 |
|---|---|---|
| committer | andreas | 2026-06-27 17:42:30 +0200 |
| commit | 31e00a3697cdebc36395411f17655a729395033c (patch) | |
| tree | 324857938042567e335c80780a82c9331496ed91 /include/qntan | |
| parent | 1be7983a349d8281fa692921b3da333815e7463f (diff) | |
| download | Qntan-31e00a3697cdebc36395411f17655a729395033c.tar.gz Qntan-31e00a3697cdebc36395411f17655a729395033c.zip | |
Introduce LoggerFactory
Diffstat (limited to 'include/qntan')
| -rw-r--r-- | include/qntan/Qntan.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index ea35e70..e159546 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -66,6 +66,7 @@ struct Qntan_MemArena; struct Qntan_Executor; struct Qntan_Scheduler; struct Qntan_Logger; +struct Qntan_LoggerFactory; struct Qntan_IoMux; struct Qntan_File; struct Qntan_FileSystem_Dirent; @@ -365,6 +366,34 @@ struct Qntan_Logger { +#ifndef Qntan_LoggerFactory_getLogger +# define Qntan_LoggerFactory_getLogger(A, B) (*A)->getLogger(A, B) +#endif + +struct Qntan_LoggerFactory { + /* TODO: Clarify resource responsibilities: For how long is the + * returned logger valid? What happens if called twice? How to + * `unref()` a logger we got? ... + */ + struct Qntan_Logger**(*getLogger)( struct Qntan_LoggerFactory**, char const*name ); + /* A ZERO-TERMINATED identifier identifying the requested logger. + * Usually this should be an unique, short, printable name. Eg + * "LibFoo/ItemProcessor", "LibBar/CustomerService" or whatever. + * This is solely an indicator for the implementation so it can + * categorize/group/manage loggers. An impl may also decide to just + * completely ignore the given hint. + */ +}; + + + + + + + + + + #ifndef Qntan_IoMux_read # define Qntan_IoMux_read(A, B, C, D, E, F, G) (*A)->read(A, B, C, D, E, F, G) #endif |
