Skip to content

Option to additionally write to a log file (or to stderr) #66

@JayBrown

Description

@JayBrown

Is your feature request related to a problem? Please describe.
It would be nice to be able to write logs to a file too (in addition to writing to the unified log). For everyday macOS users, the unified log is very hard to comb through, so giving them an option to just open a regular log file would be a plus.

Describe the solution you'd like
Add either an -f or an -r option to flog, so we can additionally either write directly to a file, e.g. with

flog -f "$HOME/Library/Logs/uk.co.fidgetbox.log" -l fault -s uk.co.fidgetbox -c general 'unrecoverable failure'

…or tell flog to write to standard error, so we can redirect that to a file, e.g. with

flog -r -l fault -s uk.co.fidgetbox -c general 'unrecoverable failure' 2>> "$HOME/Library/Logs/uk.co.fidgetbox.log"

Describe alternatives you've considered
(none come to mind)

Additional context
The macOS-built-in logger program does not have an option to write to a file directly, but it has an option (-s) to write to stderr, so the user can redirect.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions