Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shell Log

A command-line tool for redirecting and logging command output with automatic log rotation and management.

中文文档

Usage

Execute Command

# 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 ping

Configuration

Create 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

Options

  • -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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages