views:

46

answers:

4

This question is language-agnostic. What is the difference between the enumerated levels. In applications I've seen many INFO messages that seemed DEBUG info to me and vice-versa.

+1  A: 

Well, there are a number of different interpretations for this. My personal opinion is:

  • INFO - information relating to the status or progress of the application. This is where information that would be useful to determine the current state of the application should be written.
  • DEBUG - information related to internal processes or failures in the application. This is where failures and diagnostic information should be written.

None of the above is standardized, but represents my opinion and observations.

George Edison
A: 

i'd say, the conceptual difference is the target audience. "info" is for users working with an application, "debug" is for developers working on the application itself.

stereofrog
Sorry to downvote, but i think that's a difference that's so profound it must be reflected in a difference in the channel used for the logging, not just the level. The typical logging setup sends all logging, at whatever level, to the same log files, perhaps with higher-priority messages going to extra channels like email or the console or whatever. But communication with users needs to be in-band with the user interface, which is not something that, ISTM, it would be sensible to plumb into the logging framework.
Tom Anderson
+1  A: 

My rule of thumb is that if you turn debug logging on for some component, the log should go so fast that it's exciting to watch, whereas if you turn info logging on, the log should go so slowly that it's calming to watch.

You can then regulate the log level according to your mood: if you're doing some hacking, you need stimulation, so you turn on debug logging and get into the flow of what's happening; if you're monitoring a build or a test run, you turn on info logging, and observe that everything is ticking over nicely.

Tom Anderson
+1  A: 

This Article on ddj.com covers this topic besides others. Although it says "BAsic" instead of "Info", which is probably more correct:

* Logging Class 0: Basic
      o Data sources/documents/connections opened and closed
      o Size or number of items in opened documents
      o Commands executed
      o User or requester information
      o All messages shown to users
      o All answers/choices users have made 
* Logging Class 1: Extended
      o Information from certain important functions called, such as executed or passed program paths.
      o Information about received and processed events/requests
      o All status information shown to users 
* Logging Class 2: Debug
      o Information from within loops for all iterations
      o Extensive data dumps
      o Additional debug information 
RED SOFT ADAIR