17.9. O log do processamento

Nota

Esta lição descreve o log de processamento

Todas as análises realizadas com a estrutura de processamento são registradas em seu próprio sistema de registros. Isso permite que você saiba mais sobre o que foi feito com as ferramentas de processamento, para resolver os problemas quando eles acontecem, e também para reexecutar as operações anteriores, uma vez que o sistema de registros também implementa alguma interatividade.

Para abrir o log, selecione o item correspondente no menu de processamento. Você verá o seguinte diálogo.

../../../_images/log.png

Ele contém quatro blocos de informações: Informação, Erro, Avisos e Algoritmos. Aqui tem uma descrição de todas elas.

  • Informação. Alguns algoritmos podem deixar aqui informações sobre a sua execução. Por exemplo, os algoritmos que exigem uma aplicação externa geralmente registram a saída do console de que há aplicação para esta entrada. Se você der uma olhada nele, você vai ver que a saída do algoritmo SAGA que acabamos de executar (e que não conseguem executar porque os dados de entrada não estava correto) foi armazenada aqui.

../../../_images/log-saga.png

This is helpful to understand what is going on. Advanced users will be able to analyze that output to find out why the algorithm failed. IF you are not an advanced user, this will be useful for others to help you diagnose the problem you are having, which might be a problem in the installation of the external software or an issue with the data you provided.

  • Warnings. Even if the algorithm could be executed, some algorithms might leave warnings in case the result might not be right. For instance, when executing an interpolation algorithm with a very small amount of points. The algorithm can run and will produce a result, but it is likely that it will not be correct, since more points should be used. It’s a good idea to regularly check for this type of warnings if you are not sure about some aspect of a given algorithm.
  • Error. Errors that appear and are not directly related to external applications are logged in this section.
  • Algorithms. All algorithms that are executed, even if they are executed from the GUI and not from the console (which will be explained later in this manual) are stored in this part of the log as a console call. That means that everytime you run an algorithm, a console command is added to the log, and you have the full history of your working session. Here is how that history looks like
../../../_images/history1.png

This can be very useful when starting working with the console, to learn about the syntax of algorithms. We will use it when we discuss how to run analysis commands from the console.

The history is also interactive, and you can re–run any previous algorithm just by double–clicking on its entry. This is an easy way of replicating the work we already did before.

For instance, try the following. Open the data corresponding to the first chapter of this manual and run the algorithm explained there. Now go to the log dialog and locate the last algorithm in the list, which corresponds to the algorithm you have just run. Double–click on it an a new result should be produced, just like when you run it using the normal dialog and calling it from the toolbox.

17.9.1. hard Avançado

You can also modify the algorithm. Just copy it, open the Plugins ‣ Python console, click on Import class ‣ Import Processing class, then paste it to re-run the analysis; change the text at will. To display the resulting file, type iface.addVectorLayer('/path/filename.shp', 'Layer name in legend', 'ogr').