Configuring MGET logging
MGET reports many processing details using Python's built-in logging facility. By default, most of this logging is turned off. To maximize performance, we recommend you leave it off until you need to debug a failure.
How logging works
Before MGET can perform any logging at all, the logging system must be initialized. This happens automatically when an MGET geoprocessing tool is executed from ArcGIS, but must be performed manually when you want to call MGET functions from Python or another programming language:
>>> from GeoEco.Logging import Logger >>> Logger.Initialize()
The initialization function attempts to configure the logging settings by:
- Reading the file Logging.ini from the GeoEco subdirectory of the user's Application Data directory, e.g. C:\Documents and Settings\jason\Application Data\GeoEco\Logging.ini
- If that fails, it tries to read the default Logging.ini file from the GeoEco Python package installation directory, e.g. C:\Python24\Lib\site-packages\GeoEco\Configuration\Logging.ini
- If that fails, it uses hard-coded settings, which cause all messages with the severity INFO, WARNING, or ERROR to be logged to stdout.
MGET processes all subsequent logging messages according teo the settings that were configured.
Enabling verbose logging
To cause all messages to be logged to the ArcGIS geoprocessing window and stdout:
- Start My Computer.
- In the address bar, type %APPDATA% and press Enter. This will display the Application Data directory for your user account.
- Create a new directory called GeoEco
- Download the file Logging.ini and save it to the GeoEco directory.
- Run your program, script or geoprocessing model again.
Disabling verbose logging
A tiny amount of CPU time is required each time a message is logged. Under the default logging configuration, the cumulative slowdown is negligible but with maximum verbosity enabled, it can add up to a significant amount of time. To restore the default configuration, simply delete or rename the Logging.ini file stored in your %APPDATA%\GeoEco directory.
What verbose logging looks like
Here is an example of the File.FindAndCopy method, exposed as the ArcGIS Find and Copy Files tool, with the default logging configuration:
The same tool with all log messages enabled:
As you can see, several pages of messages were reported, just during the finding and copying of three files. During large batch processing jobs, thousands of messages may be reported.