tui.log
tui.log MSG [LEVEL]
Appends a line to the app’s log file. stdout is the screen, so logs go to a file.
Parameters
MSG: the message.LEVEL:debug,info,warnorerror; shown in brackets. Any other text counts asinfofor the filter and is shown as written. Default:info.
Output: nothing on screen. The file gets [HH:MM:SS] [LEVEL] MSG, unless LEVEL is below the log level (tui.log.level, default info): then nothing is written.
Notes
- The file is
~/.config/DABT/apps/<TUI_APP_NAME>/logs/<yyyy-mm-dd>_<TUI_APP_NAME>.log(dabtwhen no app name is set). SetTUI_LOG_DIRbefore sourcingtui.shto use another folder.tui.log.fileprints the current path. - One file per day; an app running past midnight continues in the next day’s file.
- Fork-free once the folder exists. A log folder that can’t be created or written is ignored silently; logging never fails the caller.
- Logs are never rotated or deleted.
Example
tui.log "export started: $file"
tui.log.warn "config missing, using defaults"
See also: tui.log.level, tui.log.debug, tui.log.info, tui.log.warn, tui.log.error
