A command-line tool for redirecting and logging command output with automatic log rotation and management.
# Execute a command and log output
slog exec ping google.com
# or use alias
slog x ping google.com
# Execute with custom log name
slog -n myping x ping google.com
# Execute with custom rotation settings
slog --max-size 50 x ping google.com
# Pipe mode
ping google.com | slog -n pingCreate a config.toml file in your config directory (~/.config/slog/config.toml):
log_root_dir = "./logs"
# Global settings
max_backups = 20
max_size = 100 # MB
max_age = 30 # days
# Command-specific settings
[ping]
max_backups = 5
max_age = 1
max_size = 3-n, --name <NAME>: Specify log name--max-backups <MAX_BACKUPS>: Maximum number of log files--max-size <MAX_SIZE>: Maximum size of single log file (MB)--max-age <MAX_AGE>: Log retention days-s, --stdout <STDOUT>: Output to stdout (true/false)-c, --config <CONFIG>: Configuration file path