I'm using the Freebase Python library. It creates a log before executing:
self.log = logging.getLogger("freebase")
Where is this log in the file system? It's not in the executing directory or tmp.
That call does not store anything. It merely creates a logger object which can be bound and configured however you would like. All warnings and errors would be logged to the standard output (that's what basicConfig does), including the calls that Freebase makes.
We can also use the logging. FileHandler() function to write logs to a file in Python. This function takes the file path where we want to write our logs. We can then use the addHandler() function to add this handler to our logger object.
For example, if you have configured the root logger to log messages to a particular file. You also have a custom logger for which you have not configured the file handler to send messages to console or another log file. In this case, the custom logger will fallback and write to the file set by the root logger itself.
That call does not store anything. It merely creates a logger object which can be bound and configured however you would like.
So if in your Python code, you were to add
logging.basicConfig(level=logging.WARNING)
All warnings and errors would be logged to the standard output (that's what basicConfig does), including the calls that Freebase makes. If you want to log to the filesystem or other target, you'll want to reference the logging module documentation for more information. You may also wish to reference the Logging HOWTO.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With