Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opt: output logs #673

Merged
merged 6 commits into from
Dec 16, 2024
Merged

opt: output logs #673

merged 6 commits into from
Dec 16, 2024

Conversation

wacmkxiaoyi
Copy link
Contributor

No description provided.

logger.addHandler(handler)

if ENABLE_SEATABLE_EVENTS_LOGS_TO_STDOUT:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改为 SEATABLE_LOG_TO_STDOUT。使用通用配置,每一个组件都读取这个。并且从env里读取


if ENABLE_SEATABLE_EVENTS_LOGS_TO_STDOUT:
# logs to stdout
stdout_formatter = logging.Formatter('[seatable_event] [%(asctime)s] %(filename)s[line:%(lineno)d] [%(levelname)s] %(message)s')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seatable_event 改为 dtable-events


def _basic_config(self):
# Log to stdout. Mainly for development.
kw = {
'format': '[%(asctime)s] %(filename)s[line:%(lineno)d] [%(levelname)s] %(message)s',
'format': '[dtable_event] [%(asctime)s] %(filename)s[line:%(lineno)d] [%(levelname)s] %(message)s',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtable_event 改为 dtable-events


if os.environ.get('SEATABLE_LOG_TO_STDOUT', False):
# logs to stdout
stdout_formatter = logging.Formatter('[dtable_events] [%(asctime)s] %(filename)s[line:%(lineno)d] [%(levelname)s] %(message)s')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtable_events -> dtable-events

@@ -34,6 +35,31 @@
IMG_URL_PREFIX = 'file://dtable-bundle/asset/images/'
DTABLE_IO_DIR = '/tmp/dtable-io/'

def setup_logger(logname):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dtable-io 导入的是 dtable-events/dtable_events/app/log.py 里的 setup_logger,需要修改这里的 setup_logger。dtable_events/dtable_io/utils.py 不用添加。

@freeplant freeplant merged commit cba04e7 into master Dec 16, 2024
1 check passed
@freeplant freeplant deleted the opt_output_logs branch December 16, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants