Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

io7m-com/taskrecorder

Repository files navigation

taskrecorder

Maven Central Maven Central (snapshot) Codecov Java Version

com.io7m.taskrecorder

JVM Platform Status
OpenJDK (Temurin) Current Linux Build (OpenJDK (Temurin) Current, Linux)
OpenJDK (Temurin) LTS Linux Build (OpenJDK (Temurin) LTS, Linux)
OpenJDK (Temurin) Current Windows Build (OpenJDK (Temurin) Current, Windows)
OpenJDK (Temurin) LTS Windows Build (OpenJDK (Temurin) LTS, Windows)

Repository Relocation

Development of this project has moved to an open-source but not open-contribution model.

Source code and commits will remain publicly available perpetually, but issues and/or pull requests will be rejected and/or ignored. Additionally, this project will now only be available via a read-only mirror at:

https://codeberg.org/io7m-com/taskrecorder

taskrecorder

The taskrecorder package provides a simple abstraction to record the steps (and subtasks) performed during the execution of tasks within an application.

Features

  • Record detailed task steps for informative error reports.
  • High coverage test suite.
  • OSGi-ready
  • JPMS-ready
  • ISC license.

Usage

Create a new task, and create steps and subtasks as the application performs operations:

final Logger logger;
final TRTaskRecorderType<Integer> recorder =
  TRTaskRecorder.create(logger, "Book Flight");

recorder.beginStep("Picking best airline price...");
Airline airline;
try {
  airline = pickAirline();
  recorder.setStepSucceeded("Found airline.");
} catch (Exception e) {
  recorder.setTaskFailed("No price available.", e);
  return;
}

recorder.beginStep("Making reservation...");
try {
  int id = makeReservation(airline);
  recorder.setTaskSucceeded("Created reservation.", id);
} catch (Exception e) {
  recorder.setTaskFailed("No reservations available.", e);
  return;
}

var task = recorder.toTask();
assert task.resolution() instanceof TRSucceeded;

About

UI task recorder

Topics

Resources

License

Stars

Watchers

Forks

Contributors