8000 エラーレベルでログ出力を制御 · Issue #27 · guskma/teracotta · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

エラーレベルでログ出力を制御 #27

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

Open
guskma opened this issue Nov 29, 2019 · 4 comments
Open

エラーレベルでログ出力を制御 #27

guskma opened this issue Nov 29, 2019 · 4 comments

Comments

@guskma
Copy link
Owner
guskma commented Nov 29, 2019

今までは debug = 0または1 程度でしかログの出力を制御していなかったのを、もう少し柔軟にエラーレベル調整できるようにします。

エラーレベルの種類は面倒なのでCiscoベースで

Type result Description
emergencies 0 System is unusable
alerts 1 Immediate action needed
critical 2 Critical conditions
errors 3 Error conditions
warnings 4 Warning conditions
notifications 5 Normal but significant conditions
informational 6 Informational messages
debugging 7 Debugging messages

こんなにいらんやろ! とは思うけど、何かに使えそうな気もする。そんな気がする。。。

@guskma
Copy link
Owner Author
guskma commented Nov 29, 2019

i18n #26 のインデックスが余りまくっているので、エラーレベルを埋め込み検討
やっぱりエラーレベル8個は多いので半分に削る

Type log.ttl result Description
critical CRIT 0 Critical conditions
errors ERR 1 Error conditions
warnings WARN 2 Warning conditions
infomational INFO 3 Informational messages

@guskma
Copy link
Owner Author
guskma commented Nov 29, 2019

削った残り1bit分を一般メッセージとして割当

@guskma
Copy link
Owner Author
guskma commented Nov 29, 2019

インデックスのうち3bitを割り当て
上位1bitをログ出力フラグ
下位2bitをエラーレベル
デバッグモードが4以上ですべてのメッセージをログに出力する。

@guskma
Copy link
Owner Author
guskma commented Nov 29, 2019

CriticalとErrorsの使い分け:
設計段階で回避できるエラーの可能性がある場合はCritical →ユーザAPI開発者向け
その他、単純にうまく行かなかった場合のエラーはErrors →API利用者向け

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

No branches or pull requests

1 participant
0