Use consistent log file names, introduced initLogger (#3403)

### What problem does this PR solve?

Use consistent log file names, introduced initLogger

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [x] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
This commit is contained in:
Zhichang Yu
2024-11-14 17:13:48 +08:00
committed by GitHub
parent ab4384e011
commit 30f6421760
75 changed files with 396 additions and 402 deletions

View File

@ -13,13 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import logging
import json
from abc import ABC
from copy import deepcopy
from functools import partial
from agent.component import component_class
from agent.component.base import ComponentBase
from api.utils.log_utils import logger
class Canvas(ABC):
"""
@ -187,7 +187,7 @@ class Canvas(ABC):
if cpn.component_name == "Answer":
self.answer.append(c)
else:
logger.debug(f"Canvas.prepare2run: {c}")
logging.debug(f"Canvas.prepare2run: {c}")
cpids = cpn.get_dependent_components()
if any([c not in self.path[-1] for c in cpids]):
continue
@ -197,7 +197,7 @@ class Canvas(ABC):
prepare2run(self.components[self.path[-2][-1]]["downstream"])
while 0 <= ran < len(self.path[-1]):
logger.debug(f"Canvas.run: {ran} {self.path}")
logging.debug(f"Canvas.run: {ran} {self.path}")
cpn_id = self.path[-1][ran]
cpn = self.get_component(cpn_id)
if not cpn["downstream"]: break
@ -217,7 +217,7 @@ class Canvas(ABC):
self.get_component(p)["obj"].set_exception(e)
prepare2run([p])
break
logger.exception("Canvas.run got exception")
logging.exception("Canvas.run got exception")
break
continue
@ -229,7 +229,7 @@ class Canvas(ABC):
self.get_component(p)["obj"].set_exception(e)
prepare2run([p])
break
logger.exception("Canvas.run got exception")
logging.exception("Canvas.run got exception")
break
if self.answer: