Documentation
¶
Overview ¶
Package applog writes the desktop app's log to a file, as well as to stderr. The app opened from the Finder, the Dock, the Start menu or a desktop launcher has no terminal: what it logged went nowhere, so a user asked for magpie's log had none to send (rayem1w on X, a Codex "hit a snag" through the gateway, 0.1.2330). Only the launch agent (`magpie daemon install`, serve.log) and a `magpie tui` that left the gateway running (serve.log in magpie's cache) kept one.
The file is app.log in appdir.Logs. It is the app's alone: the launch agent's serve.log, in the same folder on a Mac, is written by launchd for `magpie serve`, a process of its own. At 5 MiB app.log becomes app.old.log, over the one before, so two files at most are kept. A panic or fatal error's trace goes to the file too (debug.SetCrashOutput), so a crash is in it.
What is logged names no key or token (the gateway logs header names, never values, and paths without their query); scrub masks what looks like one anyway, in case a vendor's error carries it.
Index ¶
Constants ¶
const ( // Name is the log's file name in appdir.Logs. Name = "app.log" // OldName is the log before the last rotation, kept beside it. OldName = "app.old.log" // Limit is the size at which the log is rotated. Limit = 5 << 20 )
Variables ¶
This section is empty.
Functions ¶
func Current ¶
func Current() string
Current is the log this process writes, or "" when it writes none (the TUI, `magpie serve`, a command).
Types ¶
This section is empty.