Skip to content

Commit

Permalink
Configure logging verbosity from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
n8henrie committed May 13, 2024
1 parent 323328b commit 729cba9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pycookiecheat/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import argparse
import json
import logging

from .chrome import chrome_cookies
from .common import BrowserType
Expand All @@ -23,9 +24,17 @@ def main() -> None:
"--output-file",
help="Output to this file in netscape cookie file format",
)
parser.add_argument(
"--verbose",
"-v",
action="count",
default=0,
help="Increase logging verbosity (may repeat), default is `logging.ERROR`",
)
args = parser.parse_args()

# todo: make this a match statement once MSPV is 3.10
logging.basicConfig(level=max(logging.ERROR - 10 * args.verbose, 0))

browser = BrowserType(args.browser)

Expand Down

0 comments on commit 729cba9

Please sign in to comment.