本文整理汇总了Python中twitter.common.log.options.LogOptions.set_disk_log_level方法的典型用法代码示例。如果您正苦于以下问题:Python LogOptions.set_disk_log_level方法的具体用法?Python LogOptions.set_disk_log_level怎么用?Python LogOptions.set_disk_log_level使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twitter.common.log.options.LogOptions
的用法示例。
在下文中一共展示了LogOptions.set_disk_log_level方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup_class
# 需要导入模块: from twitter.common.log.options import LogOptions [as 别名]
# 或者: from twitter.common.log.options.LogOptions import set_disk_log_level [as 别名]
def setup_class(cls):
cls.LOG_DIR = tempfile.mkdtemp()
LogOptions.set_log_dir(cls.LOG_DIR)
LogOptions.set_disk_log_level("DEBUG")
log.init("executor_logger")
if not cls.PANTS_BUILT and "SKIP_PANTS_BUILD" not in os.environ:
assert subprocess.call(["./pants", "src/main/python/apache/aurora/executor/bin:thermos_runner"]) == 0
cls.PANTS_BUILT = True
示例2: setup_class
# 需要导入模块: from twitter.common.log.options import LogOptions [as 别名]
# 或者: from twitter.common.log.options.LogOptions import set_disk_log_level [as 别名]
def setup_class(cls):
cls.LOG_DIR = tempfile.mkdtemp()
LogOptions.set_log_dir(cls.LOG_DIR)
LogOptions.set_disk_log_level('DEBUG')
log.init('executor_logger')
if not cls.PANTS_BUILT and 'SKIP_PANTS_BUILD' not in os.environ:
assert subprocess.call(["./pants", "binary",
"src/main/python/apache/thermos/bin:thermos_runner"]) == 0
cls.PANTS_BUILT = True
示例3: setup_class
# 需要导入模块: from twitter.common.log.options import LogOptions [as 别名]
# 或者: from twitter.common.log.options.LogOptions import set_disk_log_level [as 别名]
def setup_class(cls):
cls.LOG_DIR = tempfile.mkdtemp()
LogOptions.set_log_dir(cls.LOG_DIR)
LogOptions.set_disk_log_level('DEBUG')
log.init('executor_logger')
if not cls.PEX_PATH:
pex_dir = tempfile.mkdtemp()
assert subprocess.call(["./pants", "--pants-distdir=%s" % pex_dir, "binary",
"src/main/python/apache/thermos/runner:thermos_runner"]) == 0
cls.PEX_PATH = os.path.join(pex_dir, 'thermos_runner.pex')
示例4: FakeConfig
# 需要导入模块: from twitter.common.log.options import LogOptions [as 别名]
# 或者: from twitter.common.log.options.LogOptions import set_disk_log_level [as 别名]
Result,
ScheduleStatusResult,
ScheduledTask,
TaskConfig,
TaskQuery,
)
from mox import MockObject, Replay, Verify
from pytest import raises
# Debug output helper -> enables log.* in source.
if 'UPDATER_DEBUG' in environ:
from twitter.common import log
from twitter.common.log.options import LogOptions
LogOptions.set_disk_log_level('NONE')
LogOptions.set_stderr_log_level('DEBUG')
log.init('test_updater')
class FakeConfig(object):
def __init__(self, role, name, env, update_config):
self._role = role
self._env = env
self._name = name
self._update_config = update_config
self.job_config = None
def role(self):
return self._role
def name(self):
示例5: import
# 需要导入模块: from twitter.common.log.options import LogOptions [as 别名]
# 或者: from twitter.common.log.options.LogOptions import set_disk_log_level [as 别名]
from apache.aurora.executor.common.announcer import DefaultAnnouncerCheckerProvider
from apache.aurora.executor.common.executor_timeout import ExecutorTimeout
from apache.aurora.executor.common.health_checker import HealthCheckerProvider
from apache.aurora.executor.common.resource_manager import ResourceManagerProvider
from apache.aurora.executor.common.sandbox import DefaultSandboxProvider
from apache.aurora.executor.thermos_task_runner import (
DefaultThermosTaskRunnerProvider,
UserOverrideThermosTaskRunnerProvider
)
from apache.thermos.common.path import TaskPath
CWD = os.environ.get('MESOS_SANDBOX', '.')
app.configure(debug=True)
LogOptions.set_simple(True)
LogOptions.set_disk_log_level('DEBUG')
LogOptions.set_log_dir(CWD)
app.add_option(
'--announcer-enable',
dest='announcer_enable',
action='store_true',
default=False,
help='Enable the ServerSet announcer for this executor. Jobs must still activate using '
'the Announcer configuration.')
app.add_option(
'--announcer-ensemble',
dest='announcer_ensemble',
示例6: setup_class
# 需要导入模块: from twitter.common.log.options import LogOptions [as 别名]
# 或者: from twitter.common.log.options.LogOptions import set_disk_log_level [as 别名]
def setup_class(cls):
cls.LOG_DIR = tempfile.mkdtemp()
LogOptions.set_log_dir(cls.LOG_DIR)
LogOptions.set_disk_log_level('DEBUG')
log.init('executor_logger')
示例7: print
# 需要导入模块: from twitter.common.log.options import LogOptions [as 别名]
# 或者: from twitter.common.log.options.LogOptions import set_disk_log_level [as 别名]
app.help()
for (command, doc) in app.get_commands_and_docstrings():
if args[0] == command:
print("command %s:" % command)
print(doc)
app.quit(0)
print("unknown command: %s" % args[0], file=sys.stderr)
def generate_usage():
usage = """
thermos
commands:
"""
for (command, doc) in app.get_commands_and_docstrings():
usage += " " + "%-10s" % command + "\t" + doc.split("\n")[0].strip() + "\n"
app.set_usage(usage)
LogOptions.set_disk_log_level("NONE")
LogOptions.set_stdout_log_level("INFO")
generate_usage()
proxy_main = app.main
proxy_main()
示例8: print
# 需要导入模块: from twitter.common.log.options import LogOptions [as 别名]
# 或者: from twitter.common.log.options.LogOptions import set_disk_log_level [as 别名]
DefaultThermosTaskRunnerProvider,
UserOverrideThermosTaskRunnerProvider,
)
try:
from mesos.native import MesosExecutorDriver
except ImportError:
print(traceback.format_exc(), file=sys.stderr)
MesosExecutorDriver = None
CWD = os.environ.get("MESOS_SANDBOX", ".")
app.configure(debug=True)
LogOptions.set_simple(True)
LogOptions.set_disk_log_level("DEBUG")
LogOptions.set_log_dir(CWD)
_LOGGER_TYPES = ", ".join(LoggerMode.VALUES)
app.add_option(
"--announcer-enable",
dest="announcer_enable",
action="store_true",
default=False,
help="Enable the ServerSet announcer for this executor. Jobs must still activate using "
"the Announcer configuration.",
)