Editor's Note: The following is a co-authored article by Chris Fricke and Charles Arnold, two of our very own Geospatial Developers who have been contributing to our recently launched GitHub page
Greetings GISi company blog readers! We thought we would share the latest we've been up to with our brand-new company GitHub page.
We want our page to be a place where other developers can find resources to make life a little easier…and we're always looking for new ideas of things we can contribute to the community. This week, after a few discussions, we decided to add the ArcPy Logger library. This is something we've used internally for about a year - and had originally grown out of frustrations we had with writing messages to the ArcGIS Desktop and Server console in our geoprocessing tasks. The AddMessage, AddWarning, and AddError functions are awesome, but they are not a Pythonic method for interacting with logs. In addition, these functions require you to import ArcPy into every module that needs to write messages to the console. This can be a bit of pain during the testing process if your module does not require ArcPy to operate. Also, this can make unit testing a bit of a pain.
Enter the ArcPy Logger. For us, it has taken the frustrations out of logging - making it a total breeze. Plus it is easily reusable and can be used on 8-10 projects. Because we've found it very useful, we're very excited to share it all with you on GitHub. We hope you find it a great resource for your own projects!
You can find ArcPy Logger here
Or you can install arcpylogger with pip via
pip install arcpylogger.