From f267d55f9d4cfe11cc5a14f8c78b312b92015d4b Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 30 Oct 2021 17:29:01 -0700 Subject: [PATCH] Use functools.wraps. --- voussoirkit/operatornotify.py | 2 ++ voussoirkit/vlogging.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/voussoirkit/operatornotify.py b/voussoirkit/operatornotify.py index d34c0d4..90ab023 100644 --- a/voussoirkit/operatornotify.py +++ b/voussoirkit/operatornotify.py @@ -49,6 +49,7 @@ Examples: ''' import argparse import contextlib +import functools import io import sys import traceback @@ -239,6 +240,7 @@ def main_decorator(subject, *, log_return_value=True, **kwargs): 3. Wrap main call with main_log_context. ''' def wrapper(main): + @functools.wraps(main) def wrapped(argv, *args, **kwargs): (argv, level) = get_level_by_argv(argv) if level is None: diff --git a/voussoirkit/vlogging.py b/voussoirkit/vlogging.py index cd0a588..ff9f09f 100644 --- a/voussoirkit/vlogging.py +++ b/voussoirkit/vlogging.py @@ -8,6 +8,7 @@ and SILENT, and all loggers from getLogger are given the `loud` method. Don't forget to like, comment, and subscribe. ''' +import functools from logging import * import sys @@ -182,6 +183,7 @@ def main_decorator(main): to use --debug, --quiet, etc. on the command line without making any changes to your argparser. ''' + @functools.wraps(main) def wrapped(argv, *args, **kwargs): (level, argv) = get_level_by_argv(argv) add_root_handler(level)