Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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