Skip to main content

SetLogMetadata

Résumé

Controls whether geoprocessing tool input and output datasets' metadata is updated to include the tool name, parameters, when the tool was run, and other information.

Discussion

In a script, metadata logging is activated by default. To disable metadata logging, use arcpy.SetLogMetadata(False).

To control metadata logging in a block of code, use the LogMetadata class as a function decorator or context manager.

To control whether geoprocessing history will be logged to an .xml file, use the SetLogHistory function.

Syntaxe

SetLogMetadata(log_metadata)

Le paramètre Explication Type de données

log_metadata

Specifies whether dataset metadata is updated.

  • True—The dataset metadata will contain a Geoprocessing history section with logging of the tools used with that dataset.

  • False—The dataset metadata will not be updated.

Boolean

Exemple de code

SetLogMetadata example

Disable the update of dataset metadata if enabled.

import arcpy
if arcpy.GetLogMetadata():
    arcpy.SetLogMetadata(False)