Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Prefix process logs with identifier #168

Open
achille-roussel opened this issue Jul 6, 2023 · 0 comments
Open

Prefix process logs with identifier #168

achille-roussel opened this issue Jul 6, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@achille-roussel
Copy link
Contributor

achille-roussel commented Jul 6, 2023

When timecraft is executing multiple processes, it can be challenging to make sense of the interleaved output of the processes spawned to handle task execution.

To help differentiate the output we could take the approach used by systemd/journald which prefixes the log output with an identifier to represent the source of a log line.

Since we are currenlty using a UUID as unique identifier for a process, a natural solution would be to use this identifier to differentiate log lines, for example:

[af26258a-791a-4c7a-ac87-84e683298874] log line from main process
[dd008465-1f7c-418f-9f48-73757c4b1f6d] log line from task process

However, UUIDs take up a lot of space on the display and are difficult for humans to differentiate since the random sequence of characters carries no meaning.

Instead of the full UUID, we could use the first 8 characters of the UUIID prefix:

  • this requires making process identifiers usable by prefix so that a user can copy an identifier prefix and paste it in a timecraft command
  • we could also explore using a different type of format for identifiers; base62 would be a much shorter representation

Process identifiers could be more meaningful if they contained a human-readable part, like the module file name or a generated name. In this case, we should ensure that the log prefix is still fixed-length, variable-length prefixes would damage the readability of the timecraft output since log lines from different processes wouldn't be starting at the same position on a terminal display.

@achille-roussel achille-roussel added the enhancement New feature or request label Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant