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 /dgnss.c | |
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 'dgnss.c')
-rw-r--r-- | dgnss.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -40,7 +40,7 @@ int dgnss_open(struct gps_context_t *context, char *dgnss_service) #ifndef REQUIRE_DGNSS_PROTO return dgpsip_open(context, dgnss_service); #else - gpsd_report(1, "Unknown or unspecified DGNSS protocol for service %s\n", + gpsd_report(LOG_ERR, "Unknown or unspecified DGNSS protocol for service %s\n", dgnss_service); return -1; #endif @@ -91,10 +91,10 @@ void rtcm_relay(struct gps_device_t *session) if (session->device_type->rtcm_writer(session, session->context->rtcmbuf, (size_t)session->context->rtcmbytes) == 0) - gpsd_report(1, "Write to rtcm sink failed\n"); + gpsd_report(LOG_ERR, "Write to rtcm sink failed\n"); else { session->rtcmtime = timestamp(); - gpsd_report(2, "<= DGPS: %d bytes of RTCM relayed.\n", session->context->rtcmbytes); + gpsd_report(LOG_IO, "<= DGPS: %d bytes of RTCM relayed.\n", session->context->rtcmbytes); } } } |