File: Logging.hs

package info (click to toggle)
darcs-buildpackage 0.5.12.2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 716 kB
  • ctags: 2
  • sloc: haskell: 452; sh: 62; makefile: 56
file content (20 lines) | stat: -rw-r--r-- 604 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{- Copyright (c) 2005 John Goerzen
<jgoerzen@complete.org>
Please see the COPYRIGHT file
-}

module Logging where
import System.Log.Logger
import System.Environment

initLogging = 
    do args <- getArgs
       let (lvl, retargs) = case args of
                                      ("-v":xs) -> (DEBUG, xs)
                                      x -> (INFO, x)
       sequence_ $ map (\x -> updateGlobalLogger x (setLevel lvl))
         ["darcs-buildpackage", "main", "", "internalcmd",
          "MissingH.Cmd.safeSystem", "MissingH.Cmd.pOpen",
          "MissingH.Cmd.pipeFrom"]
       return retargs