Adding in logging

This commit is contained in:
Scott Idem
2020-09-14 17:49:25 -04:00
parent d3b6f46368
commit 6bee9c19cf
3 changed files with 53 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ from pydantic import BaseModel, EmailStr, Field
from typing import Dict, List, Optional, Set, Union
from ..lib_general import *
from ..log import *
from app.config import settings
from app.db import *
from app.redis import *
@@ -94,8 +95,24 @@ async def list_users():
"""
Get a list of users
"""
log.setLevel(logging.DEBUG)
log.debug(str(locals().keys())+' | '+str(locals().values()))
log.debug(locals())
#log.setLevel(logging.INFO)
#log.info(None)
log.setLevel(logging.WARNING)
print('***')
log.debug('This is debug') # 10 DEBUG
log.info('This is info') # 20 INFO
log.warn('This is warn') # 30 WARNING
log.warning('This is a warning') # 30 WARNING
log.error('This is an error') # 40 ERROR
log.exception('This is an exception') # 40 ERROR
log.critical('This is critical') # 50 CRITICAL
print(settings.APP_NAME)
users = [{'username': 'test.user.1'}, {'username': 'test.user.2'}, {'username': 'Scott.Idem'}]