Log

class Log.Stream(log, lvl)[source]
write(msg)[source]
flush()[source]
class Log.Log[source]
initialize(logs=[], verbosity=[], formatter=[])[source]
init_by_config(config)[source]
Parameters:config (Config.Config) –
class Log.StreamThreadLocal[source]

This will just buffer everything, thread-locally, and not forward it to any stream. The idea is that multiple tasks will run in multiple threads and you want to catch all the logging/stdout of each to not clutter the output, and also you want to keep it separate for each.

write(msg)[source]
flush()[source]
class Log.StreamDummy[source]

This will just discard any data.

write(msg)[source]
flush()[source]
Log.wrap_log_streams(alternative_stream, also_sys_stdout=False, tf_log_verbosity=None)[source]
Parameters:
  • alternative_stream (StreamThreadLocal|StreamDummy) –
  • also_sys_stdout (bool) – wrap sys.stdout as well
  • tf_log_verbosity (int|str|None) – e.g. “WARNING”
Returns:

context manager which yields (original info stream v1, alternative_stream)