Skip to content

logで表示するスタックトレースのrecentはmaxTraceSizeを超えないようにする #400

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

Closed
fukudayasuo opened this issue Aug 22, 2014 · 2 comments
Assignees
Milestone

Comments

@fukudayasuo
Copy link

maxTraceSizeに3以下の数値を設定した場合でも今の実装だとlogObj.stackTrace.recentに3件分のスタックトレースが格納されている。
(logObjはログターゲットのlog関数に渡される引数。デフォルトのログターゲットを使用した場合はコンソールログの1行目に表示される)

// log.maxStackSize = 2 の場合
 [DEBUG]11:15:11,240: msg  [{func1}() <- {func2}() <- {func3}() ...] 
 {func1}()
  {func2}() 

recentは、トレース結果の省略表示を目的としたプロパティとして扱うこととし、maxTraceSizeを超えたトレース結果にはならないように修正する。

@simdy simdy added this to the v1.1.13 milestone Aug 22, 2014
@fukudayasuo
Copy link
Author

recentは、トレース結果の省略表示を目的としたプロパティとして扱うこととし、maxTraceSizeを超えたトレース結果にはならないように修正する。

省略表示を目的としたプロパティなので、プロパティ名をrecentではなく、previewに変更する。

fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue Aug 22, 2014
スタックトレース結果のrecentをpreviewにプロパティ名変更し、maxStackTraceを超えない件数分のスタックトレース省略表示用文字列としました。
@simdy simdy closed this as completed Aug 22, 2014
@fukudayasuo fukudayasuo reopened this Aug 22, 2014
@fukudayasuo
Copy link
Author

8c9ae8e のコミットで{root}の場合と{anonymas}の場合のスタックトレースでエラーが出てしまっていました。
7a4945e で修正しました

@simdy simdy closed this as completed Aug 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants