in python/mxboard/event_file_writer.py [0:0]
def __init__(self, logdir, max_queue=10, flush_secs=120, filename_suffix=None, verbose=True):
"""Creates a `EventFileWriter` and an event file to write to.
On construction the summary writer creates a new event file in `logdir`.
This event file will contain `Event` protocol buffers, which are written to
disk via the add_event method.
The other arguments to the constructor control the asynchronous writes to
the event file:
"""
self._logdir = logdir
if not os.path.exists(self._logdir):
os.makedirs(self._logdir)
self._event_queue = six.moves.queue.Queue(max_queue)
self._ev_writer = EventsWriter(os.path.join(self._logdir, "events"), verbose=verbose)
self._flush_secs = flush_secs
self._sentinel_event = _get_sentinel_event()
if filename_suffix is not None:
self._ev_writer.init_with_suffix(filename_suffix)
self._closed = False
self._worker = _EventLoggerThread(self._event_queue, self._ev_writer,
self._flush_secs, self._sentinel_event)
self._worker.start()