duck.cli.commands.logs

Module containing the LogsCommand class for Duck project log management.

Module Contents

Classes

LogsCommand

CLI command group for managing Duck project logs.

API

class duck.cli.commands.logs.LogsCommand[source]

CLI command group for managing Duck project logs.

classmethod _get_log_files() List[pathlib.Path][source]

Return a list of log file paths in the logs directory.

static _sort_logs(logs: List[pathlib.Path], sort: str) List[pathlib.Path][source]

Sort logs based on criteria.

classmethod count_logs()[source]

Count the number of log files.

classmethod get_logs_dir() pathlib.Path[source]

Get the resolved path to the project’s logs directory.

classmethod get_logs_size(fmt: str = 'kb')[source]

Get the total size of all logs.

classmethod list_logs(max: int = -1, sort: str = 'oldest', show_size: bool = False)[source]

List Duck project logs.

classmethod purge_logs(max: int = -1, sort: str = 'oldest')[source]

Delete logs, optionally limited by count and sorted by criteria.

classmethod register_subcommands(main_command: click.Command)[source]

Register the log management subcommands.