mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-18 00:03:05 -04:00
[processing][grass] Highlight GRASS error messages and warnings in log
And catch segmentation faults from GRASS commands and show a nice helper text advising user that QGIS isn't at fault here ;) Also add a tip to try disabling the v.external option if that setting is enabled and a GRASS segfault occurs
This commit is contained in:
parent
484895e267
commit
676238b28f
@ -379,7 +379,16 @@ class Grass7Utils:
|
|||||||
if 'r.out' in line or 'v.out' in line:
|
if 'r.out' in line or 'v.out' in line:
|
||||||
grassOutDone = True
|
grassOutDone = True
|
||||||
loglines.append(line)
|
loglines.append(line)
|
||||||
feedback.pushConsoleInfo(line)
|
if any([l in line for l in ['WARNING', 'ERROR']]):
|
||||||
|
feedback.reportError(line.strip())
|
||||||
|
elif 'Segmentation fault' in line:
|
||||||
|
feedback.reportError(line.strip())
|
||||||
|
feedback.reportError('\n' + Grass7Utils.tr('GRASS command crashed :( Try a different set of input parameters and consult the GRASS algorithm manual for more information.') + '\n')
|
||||||
|
if ProcessingConfig.getSetting(Grass7Utils.GRASS_USE_VEXTERNAL):
|
||||||
|
feedback.reportError(Grass7Utils.tr(
|
||||||
|
'Suggest disabling the experimental "use v.external" option from the Processing GRASS Provider options.') + '\n')
|
||||||
|
elif line.strip():
|
||||||
|
feedback.pushConsoleInfo(line.strip())
|
||||||
|
|
||||||
# Some GRASS scripts, like r.mapcalculator or r.fillnulls, call
|
# Some GRASS scripts, like r.mapcalculator or r.fillnulls, call
|
||||||
# other GRASS scripts during execution. This may override any
|
# other GRASS scripts during execution. This may override any
|
||||||
@ -405,9 +414,12 @@ class Grass7Utils:
|
|||||||
line[len('GRASS_INFO_PERCENT') + 2:]))
|
line[len('GRASS_INFO_PERCENT') + 2:]))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
else:
|
if any([l in line for l in ['WARNING', 'ERROR']]):
|
||||||
loglines.append(line)
|
loglines.append(line.strip())
|
||||||
feedback.pushConsoleInfo(line)
|
feedback.reportError(line.strip())
|
||||||
|
elif line.strip():
|
||||||
|
loglines.append(line.strip())
|
||||||
|
feedback.pushConsoleInfo(line.strip())
|
||||||
|
|
||||||
if ProcessingConfig.getSetting(Grass7Utils.GRASS_LOG_CONSOLE):
|
if ProcessingConfig.getSetting(Grass7Utils.GRASS_LOG_CONSOLE):
|
||||||
QgsMessageLog.logMessage('\n'.join(loglines), 'Processing', Qgis.Info)
|
QgsMessageLog.logMessage('\n'.join(loglines), 'Processing', Qgis.Info)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user