代码拉取完成,页面将自动刷新
# -*- coding: utf-8 -*-
import os
from inspect import currentframe, stack, getmodule
colors = {'cyan': '\033[96m', 'purple': '\033[95m', 'blue': '\033[94m', 'green': '\033[92m', 'yellow': '\033[93m',
'red': '\033[91m', 'end': '\033[0m'}
def print_error(*args):
if os.getenv("logging.level") == "debug":
print(colors.get('red') + "OneOS_ERROR" + "(" + str(stack()[1][1]) + ":" + str(currentframe().f_back.f_lineno) + "):\n" +
colors.get('end'), ' '.join(args))
else:
print(colors.get('red') + "OneOS_ERROR:" + colors.get('end'), ' '.join(args))
def print_warn(*args):
if os.getenv("logging.level") == "debug":
print(colors.get('yellow') + "OneOS_WARN" + "(" + str(stack()[1][1]) + ":" + str(currentframe().f_back.f_lineno) + "):\n" +
colors.get('end'), ' '.join(args))
else:
print(colors.get('yellow') + "OneOS_WARN:" + colors.get('end'), ' '.join(args))
def print_info(*args):
if os.getenv("logging.level") == "debug":
print(colors.get('blue') + "OneOS_INFO" + "(" + str(stack()[1][1]) + ":" + str(currentframe().f_back.f_lineno) + "):\n" +
colors.get('end'), ' '.join(args))
else:
print(' '.join(args))
def print_debug(*args):
if os.getenv("logging.level") == "debug":
print(colors.get('cyan') +
"OneOS_DEBUG" + "(" + str(stack()[1][1]) + ":" + str(currentframe().f_back.f_lineno) + "):\n" +
colors.get('end'),
' '.join(args))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。