Skip to content

Commit

Permalink
log support. version bump to 0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wavewave committed Oct 25, 2011
1 parent 708aa00 commit 26caf23
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
5 changes: 3 additions & 2 deletions jobtester.cabal
@@ -1,5 +1,5 @@
Name: jobtester
Version: 0.0.1
Version: 0.1
Synopsis: standalone job runner for testing
Description: standalone job runner for testing: for jobqueue-xxx
License: BSD3
Expand All @@ -22,7 +22,8 @@ Library
ghc-options: -Wall -O2 -threaded -funbox-strict-fields -fno-warn-unused-do-bind
ghc-prof-options: -caf-all -auto-all
Build-Depends: base>4, cmdargs>=0.7, jobqueue-common >= 0.1.1, pipeline >= 0.3.7,
filepath, webdav-manager >= 0.0.3, ghc, HEPUtil>=0.1
filepath, webdav-manager >= 0.0.3, ghc, HEPUtil>=0.1,
hslogger, madgraph-auto
Exposed-Modules:
HEP.Automation.JobQueue.Tester.Type
HEP.Automation.JobQueue.Tester.Command
Expand Down
20 changes: 19 additions & 1 deletion lib/HEP/Automation/JobQueue/Tester/Command.hs
Expand Up @@ -7,10 +7,28 @@ import HEP.Automation.JobQueue.Tester.Job
import HEP.Automation.Pipeline.Config
import HEP.Automation.JobQueue.Config

import qualified HEP.Automation.MadGraph.Log as MadGraphLog

import System.Log.Logger
import System.Log.Handler.Syslog
import System.Log.Handler.Simple
import System.Log.Handler (setFormatter)
import System.Log.Formatter

import System.IO

commandLineProcess :: JobTester -> IO ()
commandLineProcess (Test conf tconf mname job) = do
putStrLn "test called"
startLog MadGraphLog.defaultLogChan
lc <- readConfigFile conf
tc <- readTestConfigFile tconf
startJob lc tc mname job
startJob lc tc mname job

startLog :: String -> IO ()
startLog logchanname = do
updateGlobalLogger logchanname (setLevel DEBUG)
h <- streamHandler stderr DEBUG >>= \lh -> return $
setFormatter lh
(simpleLogFormatter "[$time : $loggername : $prio] $msg")
updateGlobalLogger logchanname (addHandler h)

0 comments on commit 26caf23

Please sign in to comment.