diff options
author | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2006-10-22 15:16:22 +0000 |
---|---|---|
committer | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2006-10-22 15:16:22 +0000 |
commit | 1d0806498974e90467535dee84926d295fe256d2 (patch) | |
tree | d761f7cd60f4fd64e373ff6ceb8aea17809eb8cd /src/gsmd/gsmd.h | |
parent | 4939b432c1dd37ef5cb6d21d7a8d7f570e6cad72 (diff) |
add logging infrastructure to gsm daemon
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@98 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/gsmd/gsmd.h')
-rw-r--r-- | src/gsmd/gsmd.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gsmd/gsmd.h b/src/gsmd/gsmd.h index 7a94ef7..460e9d4 100644 --- a/src/gsmd/gsmd.h +++ b/src/gsmd/gsmd.h @@ -65,5 +65,19 @@ struct gsmd_user { u_int32_t subscriptions; /* bitmaks of subscribed event groups */ }; -#define DEBUGP(x, args ...) printf("%s:%s(%d):" x, __FILE__, __FUNCTION__, __LINE__, ## args) -#endif +#define GSMD_DEBUG 1 /* debugging information */ +#define GSMD_INFO 3 +#define GSMD_NOTICE 5 /* abnormal/unexpected condition */ +#define GSMD_ERROR 7 /* error condition, requires user action */ +#define GSMD_FATAL 8 /* fatal, program aborted */ + +extern int gsmdlog_init(const char *path); +/* write a message to the daemons' logfile */ +void __gsmd_log(int level, const char *file, int line, const char *message, ...); +/* macro for logging including filename and line number */ +#define gsmd_log(level, format, args...) \ + __gsmd_log(level, __FILE__, __LINE__, format, ## args) + +#define DEBUGP(x, args ...) gsmd_log(GSMD_DEBUG, x, ## args) + +#endif /* __GSMD_H */ |