logger.Logger

Class Logger

Class for maintaining a dictionary of data to log.

Methods

init

  1. __init__(logging_dir)

Initializes Logger.

Args:

  • logging_dir: str, Directory to which logs are written.

setitem

  1. __setitem__(
  2. key,
  3. value
  4. )

This method will set an entry at key with value in the dictionary.

It will effectively overwrite any previous data at the same key.

Args:

  • key: str, indicating key where to write the entry.
  • value: A python object to store.

is_logging_enabled

  1. is_logging_enabled()

Return if logging is enabled.

log_to_file

  1. log_to_file(
  2. filename_prefix,
  3. iteration_number
  4. )

Save the pickled dictionary to a file.

Args:

  • filename_prefix: str, name of the file to use (without iteration
    number).
  • iteration_number: int, the iteration number, appended to the end of
    filename_prefix.