Skip to main content

SetLogHistory

Resumen

Controls whether information about the operation of geoprocessing tools is written to an external log file.

Debate

In a script, history logging is enabled by default. To disable history logging, use arcpy.SetLogHistory(False).

To limit the duration of history logging, use the LogHistory class as a context manager or decorator.

To control whether geoprocessing tool input and output datasets' metadata is updated, use the SetLogMetadata function.

Sintaxis

SetLogHistory(log_history)

El parámetro Explicación Tipo de datos

log_history

Specifies whether geoprocessing history logging is enabled.

  • True—Geoprocessing history logging is enabled, and .xml log files will be created in the %AppData%\Esri\ArcGISPro\ArcToolbox\History directory.

  • False—Geoprocessing history logging is not enabled, and .xml log files will not be created.

Boolean

Muestra de código

SetLogHistory example

Disable history logging, if enabled.

import arcpy
if arcpy.GetLogHistory():
    arcpy.SetLogHistory(False)