Skip to content

Instantly share code, notes, and snippets.

@ndufrane
Created October 29, 2018 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndufrane/a625dc823ee77b0f44753fbfbf242d56 to your computer and use it in GitHub Desktop.
Save ndufrane/a625dc823ee77b0f44753fbfbf242d56 to your computer and use it in GitHub Desktop.
QGIS 3 Log errors
filename = 'c:\\Users\\ndufrane\qgis.log'
def write_log_message(message, tag, level):
with open(filename, 'a') as logfile:
logfile.write('{tag}({level}): {message}'.format(tag=tag, level=level, message=message))
QgsApplication.messageLog().messageReceived.connect(write_log_message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment