-
Notifications
You must be signed in to change notification settings - Fork 2
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
opt: output logs #673
Conversation
dtable_events/dtable_io/utils.py
Outdated
logger.addHandler(handler) | ||
|
||
if ENABLE_SEATABLE_EVENTS_LOGS_TO_STDOUT: |
There was a problem hiding this comment.
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里读取
dtable_events/app/log.py
Outdated
|
||
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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seatable_event 改为 dtable-events
dtable_events/app/log.py
Outdated
|
||
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', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dtable_event 改为 dtable-events
f343647
to
0dad414
Compare
dtable_events/app/log.py
Outdated
|
||
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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dtable_events -> dtable-events
dtable_events/dtable_io/utils.py
Outdated
@@ -34,6 +35,31 @@ | |||
IMG_URL_PREFIX = 'file://dtable-bundle/asset/images/' | |||
DTABLE_IO_DIR = '/tmp/dtable-io/' | |||
|
|||
def setup_logger(logname): |
There was a problem hiding this comment.
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 不用添加。
No description provided.