Make it possible to set custom logger

This commit is contained in:
taizan-hokuto
2020-01-18 12:38:36 +09:00
parent 2573cc18de
commit efdf07e3de
5 changed files with 36 additions and 36 deletions

View File

@@ -5,16 +5,12 @@ Parser of live chat JSON.
"""
import json
from .. import config
from .. exceptions import (
ResponseContextError,
NoContentsException,
NoContinuationsException,
ChatParseException )
logger = config.logger(__name__)
class Parser:
__slots__ = ['is_replay']
@@ -65,8 +61,7 @@ class Parser:
raise ChatParseException('Finished chat data')
unknown = list(cont.keys())[0]
if unknown:
logger.debug(f"Received unknown continuation type:{unknown}")
metadata = cont.get(unknown)
raise ChatParseException(f"Received unknown continuation type:{unknown}")
else:
raise ChatParseException('Cannot extract continuation data')
return self._create_data(metadata, contents)