pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] Logging function


From: Aleksander Morgado
Subject: Re: [pdf-devel] Logging function
Date: Tue, 19 Feb 2008 10:21:46 +0100
User-agent: Thunderbird 2.0.0.9 (Macintosh/20071031)

Hi!


   /* Enumeration of log levels */
   enum pdf_log_level_e {
      PDF_LOG_LEVEL_DEBUG   = 0,
      PDF_LOG_LEVEL_INFO    = 1,
      PDF_LOG_LEVEL_WARNING = 2,
      PDF_LOG_LEVEL_ERROR   = 3,
      PDF_LOG_LEVEL_NONE    = 4
   };

I would not use several log levels. The library is not expected to
emit traces except for debugging purposes or to notify fatal errors.

I agree. As the logs are intended only for the developers, there is no real need to have different levels.


   /* Main logging function */
   void pdf_log(enum pdf_log_level_e log_level,
                 enum pdf_log_type_e  log_type,
                 const char           *str_template,
                 ...);

I like gerel's proposal to use a conditional macro `PDF_DEBUG' (or a
set of macros `PDF_DEBUG_*' if we implement several logging scopes)
that may expand to the empty string.

Yes, probably a simple macro per module/layer would be enough.


- Aleksander




reply via email to

[Prev in Thread] Current Thread [Next in Thread]