[GHC] #9837: Introduce a logging API to GHC

GHC ghc-devs at haskell.org
Wed Nov 26 14:14:13 UTC 2014


#9837: Introduce a logging API to GHC
-------------------------------------+-------------------------------------
       Reporter:  rodlogic           |                   Owner:
           Type:  task               |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  Compiler           |                 Version:  7.8.3
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:
     Blocked By:                     |  None/Unknown
Related Tickets:                     |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 I don't have a lot of mileage with the code base, but I do see that there
 is no standard logging API that the various components can use (or there
 is and it just needs to be used??).

 At least, I would expect to see a standard API to generate log entries
 with the following minimal parts:
  * timestamp
  * Log level - for example, ERROR, WARN, INFO, DEBUG, TRACE (-v[1-3] could
 map to INFO, DEBUG and TRACE. Log levels are inclusive so INFO also means
 WARN and ERROR.
  * Component name - so we know what is the source of the log message. At
 least I would expect to see (Desugarer, Typechecker, Parser, etc)
  * the message

 It would also mean a single back-end to collect the log messages and dump
 them to a file, stdout/stderr, etc. There are many other features beyond
 this point (customize log messages, colors, filtering, etc), but in terms
 of the API that is used throughout the code base, it should be simple.

 Was this already discussed in the past? Is there already such an API in
 the codebase? Is there an existing library that we could use to achieve
 the same? Any other ideas?

 This ticket is mostly to spawn a discussion about it.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9837>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list