forked from M-Labs/artiq
1
0
Fork 0

ctlmgr: add hostname to log source

This commit is contained in:
Sebastien Bourdeauducq 2015-10-17 10:58:15 +08:00
parent 5899825eef
commit 7f5e264971
1 changed files with 2 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import logging
import subprocess import subprocess
import shlex import shlex
import socket import socket
import platform
from artiq.protocols.sync_struct import Subscriber from artiq.protocols.sync_struct import Subscriber
from artiq.protocols.pc_rpc import AsyncioClient, Server from artiq.protocols.pc_rpc import AsyncioClient, Server
@ -292,7 +293,7 @@ def main():
root_logger = logging.getLogger() root_logger = logging.getLogger()
root_logger.setLevel(logging.NOTSET) root_logger.setLevel(logging.NOTSET)
source_adder = SourceFilter(logging.WARNING + args.quiet*10 - args.verbose*10, source_adder = SourceFilter(logging.WARNING + args.quiet*10 - args.verbose*10,
"ctlmgr") "ctlmgr({})".format(platform.node()))
console_handler = logging.StreamHandler() console_handler = logging.StreamHandler()
console_handler.setFormatter(logging.Formatter( console_handler.setFormatter(logging.Formatter(
"%(levelname)s:%(source)s:%(name)s:%(message)s")) "%(levelname)s:%(source)s:%(name)s:%(message)s"))