What do you want to save?
Add Code snippet
New code examples
-
Other 2021-11-18 09:50:08
Request Logging
# logging_example.py import logging # Create a custom logger logger = logging.getLogger(__name__) # Create handlers c_handler = logging.StreamHandler() f_handler = logging.FileHandler('file.log') c_handler.setLevel(logging.WARNING) f_handler.setLevel(l... Add solution -
Other 2021-11-07 16:05:21
logging request
# logging_example.py import logging # Create a custom logger logger = logging.getLogger(__name__) # Create handlers c_handler = logging.StreamHandler() f_handler = logging.FileHandler('file.log') c_handler.setLevel(logging.WARNING) f_handler.setLevel(l... Add solution -
Python 2021-11-06 13:44:14
python logging example
import logging logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.DEBUG) logging.debug('This is debug message') logging.info('This is information message') logging.warning('This is warning message') logging.error('This is warning ... Add solution -
Python 2021-10-14 03:49:08
boto3 create bucket
import logging import boto3 from botocore.exceptions import ClientError def create_bucket(bucket_name, region=None): """Create an S3 bucket in a specified region If a region is not specified, the bucket is created in the S3 defau... Add solution -
Python 2021-10-11 16:44:05
python logging to file
import logging logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.DEBUG) logging.debug('This is debug message') logging.info('This is information message') logging.warning('This is warning message') logging.error('This is warning ... Add solution -
Other 2021-09-15 07:02:02
python log file
import logging logging.basicConfig(filename='example.log', encoding='utf-8', level=logging.DEBUG) logging.debug('This is debug message') logging.info('This is information message') logging.warning('This is warning message') logging.error('This is warning ... Add solution