public class JobStartStopLogger extends Object
The class is thread-safe as there might be multiple calls in parallel.
Constructor and Description |
---|
JobStartStopLogger(String jobDescriptionText,
ConcurrentJobMonitor monitor,
boolean showHashSeperators,
int showOngoingJobsLessThan,
Optional<MessageLogger> logger)
Creates a job-logger.
|
Modifier and Type | Method and Description |
---|---|
void |
logEnd(JobDescription job,
JobStateMonitor monitor)
Performs logging for when a job ends.
|
void |
logStart(JobDescription job)
Performs logging for when a job starts.
|
public JobStartStopLogger(String jobDescriptionText, ConcurrentJobMonitor monitor, boolean showHashSeperators, int showOngoingJobsLessThan, Optional<MessageLogger> logger)
jobDescriptionText
- a noun describing the job that appears in the log e.g. "Job"monitor
- monitors the progress of jobs.showHashSeperators
- indicates if lines of hashes should be placed before and after each
log message (adds emphasis).showOngoingJobsLessThan
- When the number of ongoing jobs is less than this threshold,
they are shown in event logs. 0 disables.logger
- write messages to logger, if defined.public void logStart(JobDescription job)
job
- the job that was started.public void logEnd(JobDescription job, JobStateMonitor monitor)
job
- the job that ended.monitor
- tracks the execution-state of a job.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.