InvokeAI/invokeai/backend
Lincoln Stein 8917a6d99b add logging support
This commit adds invokeai.backend.util.logging, which provides support
for formatted console and logfile messages that follow the status
reporting conventions of earlier InvokeAI versions.

Examples:

   ### A critical error     (logging.CRITICAL)
   *** A non-fatal error    (logging.ERROR)
   ** A warning             (logging.WARNING)
   >> Informational message (logging.INFO)
      | Debugging message   (logging.DEBUG)

This style logs everything through a single logging object and is
identical to using Python's `logging` module. The commonly-used
module-level logging functions are implemented as simple pass-thrus
to logging:

  import invokeai.backend.util.logging as ialog

  ialog.debug('this is a debugging message')
  ialog.info('this is a informational message')
  ialog.log(level=logging.CRITICAL, 'get out of dodge')
  ialog.disable(level=logging.INFO)
  ialog.basicConfig(filename='/var/log/invokeai.log')

Internally, the invokeai logging module creates a new default logger
named "invokeai" so that its logging does not interfere with other
module's use of the vanilla logging module. So `logging.error("foo")`
will go through the regular logging path and not add the additional
message decorations.

For more control, the logging module's object-oriented logging style
is also supported. The API is identical to the vanilla logging
usage. In fact, the only thing that has changed is that the
getLogger() method adds a custom formatter to the log messages.

 import logging
 from invokeai.backend.util.logging import InvokeAILogger

 logger = InvokeAILogger.getLogger(__name__)
 fh = logging.FileHandler('/var/invokeai.log')
 logger.addHandler(fh)
 logger.critical('this will be logged to both the console and the log file')
2023-04-11 10:46:38 -04:00
..
config remove vestiges of non-functional autoimport code for legacy checkpoints 2023-03-31 04:27:03 -04:00
generator fix(backend): simple typing fixes 2023-03-26 17:07:03 +11:00
image_util all vestiges of ldm.invoke removed 2023-03-03 01:02:00 -05:00
model_management add logging support 2023-04-11 09:33:28 -04:00
prompting backend..conditioning: remove code for legacy model 2023-03-09 18:15:12 -08:00
restoration remove legacy ldm code 2023-03-04 18:16:59 -08:00
stable_diffusion handle multiple tokens and embeddings in single file 2023-03-29 22:05:06 -04:00
training migrate to new HF diffusers cache location 2023-03-05 08:20:24 -05:00
util add logging support 2023-04-11 10:46:38 -04:00
web feat: use the predicted denoised image for previews 2023-03-09 20:28:06 -08:00
__init__.py refactor get_submodels() into individual methods 2023-04-06 17:08:23 -04:00
args.py remove vestiges of non-functional autoimport code for legacy checkpoints 2023-03-31 04:27:03 -04:00
generate.py add restoration services to nodes 2023-03-11 17:00:00 -05:00
globals.py Unified spelling of Hugging Face 2023-03-05 07:30:35 -06:00
safety_checker.py restore NSFW checker 2023-03-11 16:16:44 -05:00