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.
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.
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.
logging.basicConfig(filename='/path/to/file.log', filemode='w', level=logging.DEBUG)
to do simple logging of everything to a file. –
Flipper self.log
is defined as in @Matt Norris' question, subsequent calls to self.logger.debug
will not be saved to disk (assuming no intermediate calls are made)? –
Dunigan self.log.debug
would be written to the file. If you configured logging per my answer instead, calls to self.log.debug
would be ignored because they're below the specified level of logging.WARNING
. –
Ferdy self.logger.debug
calls are saved? –
Dunigan basicConfig
or otherwise configures logging), the default behavior is that messages WARNING and above are emitted to standard error and messages below WARNING (including INFO and DEBUG) are discarded. –
Ferdy © 2022 - 2024 — McMap. All rights reserved.