Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/io/log.h

    r793cce15 r9d58539  
    3636
    3737#include <stdarg.h>
    38 #include <inttypes.h>
    39 #include <bool.h>
    4038
    4139typedef enum {
     
    5149} log_level_t;
    5250
    53 typedef sysarg_t log_context_t;
    54 #define PRIlogctx PRIxn
    55 #define LOG_CONTEXT_DEFAULT 0
    56 
    57 extern const char *log_level_str(log_level_t);
    58 extern int log_level_from_str(const char *, log_level_t *);
    59 
    60 extern bool _log_shall_record(log_context_t, log_level_t);
    6151extern int log_init(const char *, log_level_t);
    62 
    63 extern log_context_t log_context_create(const char *);
    64 
    65 #define log_ctx_msg(context, level, format, ...) \
    66         do { \
    67                 if (_log_shall_record((context), (level))) { \
    68                         _log_ctx_msg((context), (level), format, ##__VA_ARGS__); \
    69                 } \
    70         } while (false)
    71 
    72 #define log_ctx_msgv(context, level, format, args) \
    73         do { \
    74                 if (_log_shall_record((context), (level))) { \
    75                         _log_ctx_msgv((context), (level), format, args); \
    76                 } \
    77         } while (false)
    78 
    79 #define log_msg(level, format, ...) \
    80         log_ctx_msg(LOG_CONTEXT_DEFAULT, (level), (format), ##__VA_ARGS__)
    81 #define log_msgv(level, format, args) \
    82         log_ctx_msgv(LOG_CONTEXT_DEFAULT, (level), (format), (args))
    83 
    84 extern void _log_ctx_msg(log_context_t, log_level_t, const char *, ...);
    85 extern void _log_ctx_msgv(log_context_t, log_level_t, const char *, va_list);
     52extern void log_msg(log_level_t, const char *, ...);
     53extern void log_msgv(log_level_t, const char *, va_list);
    8654
    8755#endif
Note: See TracChangeset for help on using the changeset viewer.