mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
improved many docstrings
This commit is contained in:
11
debug.py
11
debug.py
@@ -1,5 +1,6 @@
|
||||
import inspect
|
||||
try:
|
||||
# Use colorama for nicer console output.
|
||||
from colorama import Fore, init
|
||||
init()
|
||||
except ImportError:
|
||||
@@ -12,8 +13,13 @@ NOTICE = object()
|
||||
WARNING = object()
|
||||
ERROR = object()
|
||||
|
||||
debug_function = None
|
||||
#debug_function = print_to_stdout
|
||||
ignored_modules = []
|
||||
|
||||
|
||||
def dbg(*args):
|
||||
""" Looks at the stack, to see if a debug message should be printed. """
|
||||
if debug_function:
|
||||
frm = inspect.stack()[1]
|
||||
mod = inspect.getmodule(frm[0])
|
||||
@@ -35,8 +41,3 @@ def print_to_stdout(level, *args):
|
||||
""" The default debug function """
|
||||
msg = (Fore.GREEN + 'dbg: ' if level == NOTICE else Fore.RED + 'warning: ')
|
||||
print(msg + ', '.join(str(a) for a in args) + Fore.RESET)
|
||||
|
||||
|
||||
debug_function = None
|
||||
#debug_function = print_to_stdout
|
||||
ignored_modules = []
|
||||
|
||||
Reference in New Issue
Block a user