GsshaPy uses the default Python logging module. By default, nothing is logged anywhere. Here is how to configure your instance.

Log to file

To use the default logging:

import gsshapy

# then use gsshapy

To set custom level:

import gsshapy
gsshapy.log_to_file(filename='gsshapy_run.log', level='INFO')

# then use gsshapy
gsshapy.log_to_file(status=True, filename='/home/docs/.cache/gsshapy/log/gsshapy.log', level=None)[source]

Log events to a file.

  • status (bool, Optional, Default=True) – whether logging to file should be turned on(True) or off(False)
  • filename (string, Optional, Default=None) – path of file to log to
  • level (string, Optional, Default=None) – level of logging; whichever level is chosen all higher levels will be logged. See: https://docs.python.org/2/library/logging.html#levels