[tune] Tune onto Logging Module (#2882)

Moves Tune onto logging in Python. Ignores examples and tests.
This commit is contained in:
Richard Liaw
2018-09-16 12:09:36 -07:00
committed by GitHub
parent a8248e8628
commit f372f48bf3
17 changed files with 121 additions and 63 deletions
+4 -2
View File
@@ -2,14 +2,16 @@ from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import time
import threading
import traceback
from ray.tune import TuneError
from ray.tune.trainable import Trainable
from ray.tune.result import TIMESTEPS_TOTAL
logger = logging.getLogger(__name__)
class StatusReporter(object):
"""Object passed into your main() that you can report status through.
@@ -74,7 +76,7 @@ class _RunnerThread(threading.Thread):
self._entrypoint(*self._entrypoint_args)
except Exception as e:
self._status_reporter._error = e
print("Runner thread raised: {}".format(traceback.format_exc()))
logger.exception("Runner Thread raised error.")
raise e
finally:
self._status_reporter._done = True