Skip to main content

Module logs

Module logs 

Source
Expand description

Rotating, redacted log file shared by the host, the interface, and widgets.

Records go through the log facade. Toolblox’s own records are kept from Info up (Debug in debug builds); other crates, such as Tauri and its plugins, from Warn up. Every line is redacted before it’s written, so cookies, tickets, authorization headers, and launch URLs never reach the file, whoever logged them.

The file is logs/toolblox.log in the data folder. It rotates at 1 MB and keeps three older files, toolblox.log.1 through toolblox.log.3.

StructsΒ§

FileLogger πŸ”’
Appends records to the current file, rotating it when it grows too large.

ConstantsΒ§

BACKUPS πŸ”’
Rotated files kept next to the current one.
CRATE_PREFIX πŸ”’
Prefix of Toolblox’s own module paths, dropped from record targets.
CRATE_ROOT πŸ”’
Target of records logged from the crate root, shown as toolblox.
FILE_NAME πŸ”’
Name of the current log file.
LAUNCH_SCHEMES πŸ”’
Schemes whose URIs carry join tickets. Everything after the scheme is redacted.
MAX_FILE_BYTES πŸ”’
Size at which the current file rotates.
MAX_MESSAGE_BYTES
Longest message kept per record, in bytes. Longer messages are cut.
MAX_TAIL_LINES
Most lines tail returns when given a count.
OWN_TARGETS
Targets for records that don’t come from a Toolblox module.
REDACTED πŸ”’
Replacement for redacted values.
SECRET_KEYS πŸ”’
Keys whose values are secret wherever they appear as key=value, key: value, or "key": "value". Matched case-insensitively at word boundaries.
WHOLE_VALUE_KEYS πŸ”’
Keys whose values run to the end of the line or quote, because they can contain spaces or several name=value pairs.
WIDGET_TARGET_PREFIX
Prefix of widget record targets, followed by the widget ID.

StaticsΒ§

LOGGER πŸ”’

FunctionsΒ§

civil_from_days πŸ”’
Converts days since 1970-01-01 to a proleptic Gregorian date (Howard Hinnant’s algorithm).
directory
Folder holding the log files, once logging has started.
format_line πŸ”’
Formats one record as a redacted line: <UTC time> <LEVEL> <target>: <message>.
init
Starts logging to directory and records panics. Later calls do nothing.
is_word_byte πŸ”’
level_for πŸ”’
Highest level kept for a target.
open πŸ”’
Opens the log file for appending, creating it if needed.
redact
Replaces Roblox session cookies, launch URIs, and the values of SECRET_KEYS with [redacted].
rotate πŸ”’
Shifts toolblox.log.N to N + 1, dropping the oldest, then moves the current file to .1.
sanitize πŸ”’
Escapes control characters. With multiline, line breaks become indented continuation lines.
secret_at πŸ”’
Finds a secret starting at index and returns the byte range of its value.
skip_spaces πŸ”’
tail
Returns up to lines of the most recent log lines, oldest first, reading into rotated files when the current one is shorter. None returns every line of every file.
tail_in πŸ”’
timestamp πŸ”’
Formats a time as UTC ISO 8601 with milliseconds.
value_end πŸ”’
End of an unquoted value: the next whitespace, quote, or separator. With whole, only line breaks and quotes end it.