Module pueue_lib::log

source ·
Expand description

Helper classes to read and write log files of Pueue’s tasks.

Functions§

  • Remove the the log files of a task.
  • Create and return the two file handles for the (stdout, stderr) log file of a task. These are two handles to the same file.
  • Return the file handle for the log file of a task.
  • Get the path to the log file of a task.
  • Return the output of a task.
    Task output is compressed using snap to save some memory and bandwidth. Return type is (Vec<u8>, bool)
  • Read the last amount lines of a file to a string.
  • Return the last lines of of a task’s output.
    This output is uncompressed and may take a lot of memory, which is why we only read the last few lines.
  • Remove all files in the log directory.
  • Seek the cursor of the current file to the beginning of the line that’s located amount newlines from the back of the file.