pyphi.log.enable_logging#

pyphi.log.enable_logging(level='INFO', file=None)[source]#

Route PyPhi’s logs to the console or a file.

With no arguments, INFO-and-above messages from the pyphi logger are written to stderr through a progress-bar-safe handler. Pass file to write to that path instead. Calling this again replaces the handler a previous call installed (handlers do not stack).

Parameters:
  • level (str) – A standard level name ("DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"). An unknown name raises ValueError.

  • file (str | Path | None) – A path to log to. If None, logs go to stderr.

Return type:

None