public class Logger
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.text.DateFormat |
df |
private static java.io.PrintWriter |
masterCsv
CSV file recording task status in a tabular format: sequence number, loop,
time, task type, task name, stage, task string representation.
|
private static java.lang.String |
masterFilePath
The full path to the master log file.
|
private static java.io.PrintWriter |
masterLog
This is the common log file.
|
private static int |
reportCounter |
private static int |
reportSession |
private static java.io.File |
rootPath |
| Constructor and Description |
|---|
Logger() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static void |
cleanTaskFiles(java.lang.String taskString) |
(package private) static void |
close() |
(package private) static void |
debugDump(boolean alwaysDump)
Try to dump the debug information into the master log file.
|
(package private) static void |
debugMaster(java.lang.String message) |
(package private) static void |
debugMaster(java.lang.String message,
java.lang.Object o)
Write debug message into the master log file.
|
private static boolean |
deleteDirectory(java.io.File path) |
private static boolean |
deleteDirectory(java.io.File path,
boolean delTop)
Delete the specified directory.
|
private static int |
getLastSession(java.io.File rptFile)
Obtain the session number of the last run.
|
(package private) static java.lang.String |
getMasterFilePath() |
(package private) static java.io.File |
getPathByExtension(Task t,
java.lang.String ext) |
(package private) static java.lang.String |
getRoot()
Return the path to jobman home directory.
|
(package private) static void |
logSuccess(Task t)
Log success message into the task log file.
|
(package private) static void |
makeNodeDir(java.lang.String taskString) |
private static boolean |
parseErrFile(java.io.File errF)
Parse an error file.
|
private static void |
printHeader() |
(package private) static java.util.ArrayList<java.lang.String> |
readParameter(Node parent,
java.lang.String paramChild)
Read the parameter file for a parameterized job.
|
(package private) static void |
report(Task t) |
(package private) static void |
setup(java.lang.String path,
java.lang.String topJob)
Set up the logging system.
|
private static Status |
statusByLog(java.io.File logP,
java.lang.String taskName)
Obtain the status of the task by parsing the log file of the task.
|
(package private) static Status |
taskStatus(Task t)
Scan the log and the err files to see if the task has completed
successfully.
|
(package private) static void |
traceMaster(java.lang.Exception t)
Write non-critical Exception message into the master log file.
|
(package private) static void |
traceMaster(java.lang.String message)
Write message into the master log file.
|
(package private) static void |
warnMaster(java.lang.Exception t)
Write a Exception as a warning message into the master log file.
|
(package private) static void |
warnMaster(java.lang.String message)
Write a warning message into the master log file.
|
(package private) static void |
warnMaster(java.lang.String message,
java.lang.Exception t)
Write a warning message and record Exception into the log file.
|
(package private) static void |
writePar(Task sh,
java.lang.String param) |
(package private) static void |
writePar(Task sh,
java.lang.String[] param) |
private static java.text.DateFormat df
private static java.io.PrintWriter masterLog
private static java.lang.String masterFilePath
private static java.io.File rootPath
private static java.io.PrintWriter masterCsv
private static int reportSession
private static int reportCounter
static void setup(java.lang.String path,
java.lang.String topJob)
throws java.lang.Exception
path - The full path of the jobman home directory.topJob - The the name of the top most job to be run.java.lang.Exceptionstatic java.lang.String getRoot()
static java.lang.String getMasterFilePath()
static void traceMaster(java.lang.String message)
message - The message to be written into the log file.static void traceMaster(java.lang.Exception t)
t - The Exception to be logged.static void warnMaster(java.lang.Exception t)
static void warnMaster(java.lang.String message)
static void warnMaster(java.lang.String message,
java.lang.Exception t)
static void debugMaster(java.lang.String message,
java.lang.Object o)
message - A string of debug message.o - The object whose toString() will be appended.static void debugMaster(java.lang.String message)
static void debugDump(boolean alwaysDump)
alwaysDump - Insist dump the debug info regardless configuration
settings.private static boolean parseErrFile(java.io.File errF)
throws java.lang.Exception
errF - The handle of the error file to be parsed.java.lang.Exceptionstatic void logSuccess(Task t)
static Status taskStatus(Task t)
private static Status statusByLog(java.io.File logP, java.lang.String taskName) throws java.lang.Exception
logP - The path to the log file that is used to determine the job
status.java.lang.Exceptionstatic void cleanTaskFiles(java.lang.String taskString)
static void makeNodeDir(java.lang.String taskString)
static java.io.File getPathByExtension(Task t, java.lang.String ext)
static java.util.ArrayList<java.lang.String> readParameter(Node parent, java.lang.String paramChild) throws java.lang.Exception
parent - The parent job.paramChild - The job name of the child job specifying parameters.java.lang.Exceptionprivate static boolean deleteDirectory(java.io.File path,
boolean delTop)
private static boolean deleteDirectory(java.io.File path)
static void writePar(Task sh, java.lang.String param) throws java.lang.Exception
java.lang.Exceptionstatic void writePar(Task sh, java.lang.String[] param) throws java.lang.Exception
java.lang.Exceptionprivate static void printHeader()
static void report(Task t)
static void close()
private static int getLastSession(java.io.File rptFile)
throws java.lang.Exception
rptFile - The path to report file "jobman.csv".java.lang.ExceptionCopyright © 2006-2015 Heng Sun.