Skip to main content
BD2 Mod Manager supports several command-line arguments for controlling logging behavior and displaying version information.

Available arguments

Version information

BD2ModManager.exe --version
Displays the current version of BD2 Mod Manager and exits immediately. Example output:
BD2ModManager v3.2.4

Logging options

All logging options are grouped under the “Logging” argument group. By default, logs are written to BD2ModManager-logs.log in the application data directory.

Set log level

BD2ModManager.exe --log-level LEVEL
Short form: -l LEVEL Controls the verbosity of log output. Available levels (from most to least verbose):
  • debug - Detailed diagnostic information (default)
  • info - General informational messages
  • warning - Warning messages only
  • error - Error messages only
  • critical - Critical errors only
Examples:
# Show only warnings and errors
BD2ModManager.exe --log-level warning

# Show all debug information
BD2ModManager.exe -l debug

# Show only critical errors
BD2ModManager.exe --log-level critical

Filter logs by name

BD2ModManager.exe --log-filter NAME
Short form: -f NAME Filters log output to show only messages from a specific module or function name. This is useful for debugging specific components. Examples:
# Show only logs from the sync worker
BD2ModManager.exe --log-filter SyncWorker

# Show only logs from the mod manager model
BD2ModManager.exe -f ModManagerModel

# Show only logs from a specific module
BD2ModManager.exe --log-filter src.services.workers

Disable logging

BD2ModManager.exe --no-logs
Short form: -n Completely disables logging. No log file will be created or written to. Example:
# Run without creating any logs
BD2ModManager.exe --no-logs
Disabling logs makes it difficult to diagnose issues if something goes wrong. Only use this option if you have a specific reason.

Combining arguments

You can combine multiple arguments in a single command:
# Set log level to info and filter by module name
BD2ModManager.exe --log-level info --log-filter workers

# Use short forms
BD2ModManager.exe -l error -f SyncWorker

Implementation details

The command-line parser is implemented using Python’s ArgumentParser:
parser = ArgumentParser(
    description=f"BD2ModManager v{__version__}",
    epilog="Example: python main.py --log-level debug"
)

parser.add_argument(
    "--version",
    action="version",
    version=f"%(prog)s {__version__}"
)

logging_group = parser.add_argument_group("Logging")

logging_group.add_argument(
    "-l", "--log-level",
    type=str,
    default="debug",
    choices=["debug", "info", "warning", "error", "critical"],
    help="Set the logging verbosity level (default: %(default)s)."
)

logging_group.add_argument(
    "-f",
    "--log-filter",
    type=str,
    metavar="NAME",
    help="Filter logs by a specific module or function name."
)

logging_group.add_argument(
    "-n",
    "--no-logs",
    action="store_true",
    default=False
)

Log setup

When logging is enabled, the application initializes the logging system:
if not args.no_logs:
    setup_logging(
        app_paths.app_path / "BD2ModManager-logs.log",
        args.log_level,
        args.log_filter
    )

Use cases

Debugging sync issues

BD2ModManager.exe --log-level debug --log-filter sync
This shows detailed debug output only for sync-related operations.

Reducing log file size

BD2ModManager.exe --log-level error
Only errors are logged, keeping the log file small.

Performance testing

BD2ModManager.exe --no-logs
Disable logging entirely to eliminate any I/O overhead during performance tests.
Log files are stored in the application data directory and can grow large over time. Consider periodically clearing old logs or using higher log levels to reduce file size.

Build docs developers (and LLMs) love