Logging

Prev Next

Logs are saved to the temp directory and are also output to the console with a default logging level of INFO. You can view the file path of the temp directory or the log file:

import glasswall


print(glasswall._TEMPDIR)
print(glasswall.config.logging.log_file_path)
>>> C:\Users\<UserName>\AppData\Local\Temp\glasswall
>>> C:\Users\<UserName>\AppData\Local\Temp\glasswall\logs\2021-03-15 122826.txt

The logging level can be modified. For a list of logging levels see https://docs.python.org/3/library/logging.html#logging-levels

import logging

import glasswall


# Modify logging level for logs to the console
glasswall.config.logging.console.setLevel(logging.DEBUG)

# Modify logging level for logs to file
glasswall.config.logging.log.setLevel(logging.DEBUG)