fix logger
This commit is contained in:
@ -1,12 +1,14 @@
|
||||
import pickle
|
||||
import random
|
||||
import time
|
||||
import traceback
|
||||
from pathlib import Path
|
||||
from threading import RLock
|
||||
from typing import Optional
|
||||
|
||||
from app.core.config import settings
|
||||
from app.core.meta import MetaBase
|
||||
from app.log import logger
|
||||
from app.utils.singleton import Singleton
|
||||
from app.schemas.types import MediaType
|
||||
|
||||
@ -118,7 +120,7 @@ class TmdbCache(metaclass=Singleton):
|
||||
return data
|
||||
return {}
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
logger.error(f'加载缓存失败:{str(e)} - {traceback.format_exc()}')
|
||||
return {}
|
||||
|
||||
def update(self, meta: MetaBase, info: dict) -> None:
|
||||
|
@ -213,8 +213,7 @@ class TmdbHelper:
|
||||
logger.error(f"连接TMDB出错:{str(err)}")
|
||||
return None
|
||||
except Exception as e:
|
||||
logger.error(f"连接TMDB出错:{str(e)}")
|
||||
print(traceback.print_exc())
|
||||
logger.error(f"连接TMDB出错:{str(e)} - {traceback.format_exc()}")
|
||||
return None
|
||||
logger.debug(f"API返回:{str(self.search.total_results)}")
|
||||
if len(movies) == 0:
|
||||
@ -261,8 +260,7 @@ class TmdbHelper:
|
||||
logger.error(f"连接TMDB出错:{str(err)}")
|
||||
return None
|
||||
except Exception as e:
|
||||
logger.error(f"连接TMDB出错:{str(e)}")
|
||||
print(traceback.print_exc())
|
||||
logger.error(f"连接TMDB出错:{str(e)} - {traceback.format_exc()}")
|
||||
return None
|
||||
logger.debug(f"API返回:{str(self.search.total_results)}")
|
||||
if len(tvs) == 0:
|
||||
@ -313,7 +311,7 @@ class TmdbHelper:
|
||||
return True
|
||||
except Exception as e1:
|
||||
logger.error(f"连接TMDB出错:{e1}")
|
||||
print(traceback.print_exc())
|
||||
print(traceback.format_exc())
|
||||
return False
|
||||
return False
|
||||
|
||||
@ -324,7 +322,7 @@ class TmdbHelper:
|
||||
return None
|
||||
except Exception as e:
|
||||
logger.error(f"连接TMDB出错:{str(e)}")
|
||||
print(traceback.print_exc())
|
||||
print(traceback.format_exc())
|
||||
return None
|
||||
|
||||
if len(tvs) == 0:
|
||||
@ -404,7 +402,7 @@ class TmdbHelper:
|
||||
return None
|
||||
except Exception as e:
|
||||
logger.error(f"连接TMDB出错:{str(e)}")
|
||||
print(traceback.print_exc())
|
||||
print(traceback.format_exc())
|
||||
return None
|
||||
logger.debug(f"API返回:{str(self.search.total_results)}")
|
||||
# 返回结果
|
||||
|
Reference in New Issue
Block a user