bugGPSD - Bugs: bug #44603, gpsd/syslog log levels mismatch

 
 

bug #44603: gpsd/syslog log levels mismatch

Submitter:  Zbigniew Chyla <zchyla_nokia>
Submitted:  Sun 22 Mar 2015 07:59:05 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 22 Mar 2015 07:59:05 PM UTC, original submission:  

The gpsd calls syslog() (from gpsd_vlog), setting syslog's log level to LOG_ERR only for gpsd's LOG_SHOUT. All other log levels, including LOG_ERROR, are mapped to syslog's LOG_NOTICE.

The expected behaviour would be mapping LOG_ERROR to LOG_ERR.

It looks like the mismatch was introduced as a side effect of f258275 - numeric value of LOG_ERROR was changed from 0 to -1, but other ocurrences of loglevel 0 were not updated accordingly, like this one:

syslog((errlevel == 0) ? LOG_ERR : LOG_NOTICE, "%s", outbuf);

As a first step, I attached a patch that replaces numeric loglevel 0 with its symbolic name, so that we can clearly see the problem:


commit d935ba321d96576760797f570f89fd582d4c0f99
Author: Zbigniew Chyla <zbigniew.chyla@nokia.com>
Date:   Sun Mar 22 21:55:51 2015 +0200

    Use LOG_* symbol when setting/comparing log level

    Currently, debug level 0 is actually LOG_SHOUT.
    This change doesn't affect generated binary code.

 3 files changed, 4 insertions(+), 4 deletions(-)


The next step depends on the desired behaviour. Problably LOG_SHOUT should be replaced with LOG_ERROR in assignments and comparison.

Zbigniew Chyla <zchyla_nokia>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by esr (Updated the item)
  • -email is unavailable- added by zchyla_nokia (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-03 esr Open/ClosedOpen Closed
    2015-03-22 esr StatusNone Fixed
    2015-03-22 zchyla_nokia Attached File- Added 0001-Use-LOG_-symbol-when-setting-comparing-log-level.patch, #33423

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code