def print_warning(msg, pos = None):
"""
Output a warning message to the user.
"""
if verbosity_level < VERBOSITY_WARNING:
return
if pos:
msg = str(pos) + ": " + msg
msg = " nmlc warning: " + msg
if (sys.stderr.isatty()) and (os.name == 'posix'):
msg = "\033[33m" + msg + "\033[0m"
hide_progress()
print(msg, file=sys.stderr)
show_progress()
评论列表
文章目录