Replies: 1 comment
-
Sorry, I'm a new in programming python and nearly zero python skills. Code: import logging
import sys
# Create a custom logger
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG) # Set the default log level
# Create handlers
stdout_handler = logging.StreamHandler(sys.stdout)
stderr_handler = logging.StreamHandler(sys.stderr)
# Set levels for handlers
stdout_handler.setLevel(logging.DEBUG)
stderr_handler.setLevel(logging.ERROR)
# Create formatters and add them to the handlers
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
stdout_handler.setFormatter(formatter)
stderr_handler.setFormatter(formatter)
# Add handlers to the logger
logger.addHandler(stdout_handler)
logger.addHandler(stderr_handler)
# Example usage
logger.debug('This is a debug message')
logger.info('This is an info message')
logger.warning('This is a warning message')
logger.error('This is an error message')
logger.critical('This is a critical message') Log ./bla.py
Log: uvicorn "bla:app" --reload --host localhost --port 8000
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
Only startoption c) (uvicron from shell) do not produce the errror.
I used an example from SQL-Model online-documentation
Operating System
Linux, macOS
Operating System Details
No response
SQLModel Version
0.0.18
Python Version
Python 3.12.3
Additional Context
Working with vscode and internal debugger. The same problem.
Beta Was this translation helpful? Give feedback.
All reactions