diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2006-11-02 05:07:11 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2006-11-02 05:07:11 +0000 |
commit | 51cce15a3b63a3802a2301fb41bdfc25d8a77228 (patch) | |
tree | 0c4dcaa540ef7d1afa88b205a169f55c8fa38e94 /gpsd.h | |
parent | f14c20f3545fd3bcdf3d77c9fba8871d93da2027 (diff) | |
download | gpsd-51cce15a3b63a3802a2301fb41bdfc25d8a77228.tar.gz |
Define uniform log level macros.
This patch defines a uniform set of log levels and changes all gpsd_report()
instances to use them. In most cases (I'd say about 80%) this will make
no observable difference, as the numeric log levels the code was using were
not too badly inconsistent anyway. The new log level macros are defined
and described in gpsd.h.
The main thing I wanted was to be able to consistently force dumping
of all I/O to devices and clients with -D 4. Some drivers didn't honor
this. One or two still may not through lack of an internal write() wrapper
that does logging; there will need to be some followup changes.
Level 0 messages are always displayed, but to make the semantics clearer
there are two defines LOG_ERR and LOG_SHOUT.
Level 5 is still super-raw I/O reporting. Level 6 and 7 messages are
tagged RAW_LOG+1 and RAW_LOG+2; I was particularly careful about these
because we have one report of a user who is getting good results from
Garmin serial only at -D 7 or up, and perish forbid I should interfere
with that bug being found.
Diffstat (limited to 'gpsd.h')
-rw-r--r-- | gpsd.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -236,6 +236,15 @@ struct gps_device_t { } driver; }; +/* logging levels */ +#define LOG_ERR 0 /* errors, display always */ +#define LOG_SHOUT 0 /* not an error but we should always see it */ +#define LOG_WARN 1 /* not errors but may indicate a problem */ +#define LOG_INF 2 /* key informative messages */ +#define LOG_PROG 3 /* progress messages */ +#define LOG_IO 4 /* IO to and from devices */ +#define LOG_RAW 5 /* raw low-level I/O */ + #define IS_HIGHEST_BIT(v,m) (v & ~((m<<1)-1))==0 /* here are the available GPS drivers */ |