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

Prefix process logs with identifier #168

@achille-roussel

Description

@achille-roussel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions