1
0
mirror of https://github.com/ceph/ceph synced 2025-01-19 01:21:49 +00:00

teuthology-worker: log to a file with timestamps

This commit is contained in:
Josh Durgin 2011-08-03 15:28:46 -07:00
parent 5897d7b95d
commit ac0a469b78

View File

@ -33,6 +33,11 @@ describe. One job is run at a time.
help='path under which to archive results',
required=True,
)
parser.add_argument(
'-l', '--log-dir',
help='path in which to store logs',
required=True,
)
ctx = parser.parse_args()
@ -42,6 +47,9 @@ describe. One job is run at a time.
logging.basicConfig(
level=loglevel,
filename=os.path.join(ctx.log_dir, 'worker.{pid}'.format(pid=os.getpid())),
format='%(asctime)s.%(msecs)03d %(levelname)s:%(name)s:%(message)s',
datefmt='%Y-%m-%dT%H:%M:%S',
)
if not os.path.isdir(ctx.archive_dir):