An open API service indexing awesome lists of open source software.

https://github.com/wraith13/bugbeard

Trace and profiling for C++ via single header file.
https://github.com/wraith13/bugbeard

Last synced: 9 months ago
JSON representation

Trace and profiling for C++ via single header file.

Awesome Lists containing this project

README

          

# バグベアード -bugbeard-

⚠ この README は編集中です

## about バグベアード -bugbeard-

![バグベアード -bugbeard-](resource/bugbeard48.png)

簡潔かつ乱暴に説明すると、このモジュールは `printf` デバッギングを簡単且つゴージャスに行う為のものです。

バグベアードは C++ プログラマの目となり、その膨大なログで大半のバグを丸裸にします。

- [ライセンス情報](LICENSE_1_0.txt)
- 最終更新日:2011-03-21

> 2008-02-24 "Coming soon..." などと謳いつつ5年近くほったらかしにしてましたが、ついに正式版のリリースです。
> 作者が言うのなんですが、このモジュールは非常に強力且つ凶悪です。ご利用いただければあなたの C++ プログラミングにおけるデバッグシーンに劇的な変化をもたらすであろうことお約束します。

2008-02-25 `inline` 指定が抜けてて複数のコンパイル単位から利用するとリンク時にシンボルが衝突する問題を修正。

2008-03-10 以下の点を修正。

- 悪魔の契約" に「順序不安定」を追記。
- `bug_compact_tree_logger` の追加。
- インクルードの `` のパスを `` に修正。
- 命名規則的に明らかにおかしいところ一部修正
- `BUG_SINT64_TYPE` → `bug_sint64_type`
- `BUG_UINT64_TYPE` → `bug_uint64_type`
- `BUG_OutputDebugString_writer` → `bug_OutputDebugString_writer`
- `BUG_get_winver` → `bug_get_winver`
- `run_string` → `bug_run_string`
- `bug_short_clock_stamp_sx_with_date` → `bug_short_clock_stamp_with_date`
- `bug_uni_logger` を削除。( 既にその役目は `bug_thread_local_storage` に取って代わられているので。)

2008-04-01 以下の点を修正。

- `BUG_MASK_SOURCECODE` の追加。
- "悪魔の契約" の「構文の制限」に "例外仕様構文" に関する記述を追記。

2008-06-05 以下の点を修正。

- VC でバグベアード適用時に過剰となる警告を抑止する為に `#pragma warning(disable:1011)` を追加。
- `bug_thread_local_storage::init()` に `base_type::set_target_storage()` を含める。
- g++ のバージョンによってはコンパイルエラーの原因になるので `PTHREAD_MUTEX_INITIALIZER` の使用を中止。( `pthread_mutex_init()` による初期化を行っているので元々不要な指定。 )
- 現時点のバグベアードでは不要だが対称性の観点から bug_unlock クラスを追加。
- ロケーション情報の除去オプション(`BUG_WITHOUT_LOCATION_INFO`)を追加。
- `switch` の値が出力されないバグの解決。

2008-09-23 以下の点を修正。

- プロファイル対応
- カバレッジ対応
- プロファイル&カバレッジのサンプルコードを追加。
- `bug_tsv_logger` でヘッダー行を出力するように修正。
- ヘッダー行の出力を抑止する指定マクロ(`BUG_WITHOUT_TSV_LOG_HEADER`, `BUG_WITHOUT_TSV_PROFILE_HEADER`, `BUG_WITHOUT_TSV_COVERAGE_HEADER`)の追加。
- `BUG_DISABLED_PSAPI` 指示マクロの追加( このマクロが定義されると `bug_enum_module_version_info()` の実装を行わない )。
- `QueryPerformance()` の結果を秒+マイクロ秒単位へ変換して表示を行う `bug_QueryPerformanceSecond_stamp` の追加。
- `OSVERSIONINFOEX` まわりで `WINVER` の判定が精確でなかった箇所の修正。
- `bug_logger::stamp` を `private` に変更し、`bug_logger::get_new_stamp()`, `bug_logger::get_last_stamp()` を追加。
- `bug_drive_info()` の出力に sectors-per-cluster と bytes-per-sector を追加。
- `BUG_DEFINE_GLOBAL_LOGGER` と `BUG_DEFINE_GLOBAL_PROFILER` の追加。
- `bug_windows_system_info()` の追加。
- `bug_file_hash()` を追加。
- `bug_enum_module_hash()` を追加。
- `bug_logger::get_instance()` の追加および `BUG_LOG` マクロの修正(ただのリファクタリング)。
- `bug_logger::get_process_id()` および `bug_logger::get_thread_id()` をクラスの外に出しに `bug_get_process_id()` および `bug_get_thread_id()` に変更(ただのリファクタリング)。
- 不必要な `#include ` を削除。
- `#pragma warning(disable:1011)` は VC じゃなくて Intel ででる警告なので icc に限定。

2008-11-01 以下の点を修正。

- プロファイル&カバレッジ測定サンプル中の `bug_tsv_profile_logger` を `bug_tsv_profiler` に訂正。(間違っていたのはこのページ中の表記のみで、ダウンロード用の同サンプルのファイルは元から正しい記述である `bug_tsv_profiler` になっています。)

2010-02-14 以下の点を修正。

- `#include ` を `#include ` に修正。([ご指摘](http://twitter.com/graighle/status/6722927223)、感謝)
- 一部 `BUT_T()` が使用されていなかった箇所に `BUT_T()` を適用。([ご指摘](http://twitter.com/USAGI_WRP/status/6680888390)、感謝)
- `bug_get_winver()` を Windows 7 などにも対応した最新の状態に更新。
- [Boost.勉強会](http://atnd.org/events/1839)で発表した[バグベアード入門の ustream へのリンクと発表資料](#primer)の追加。

2011-03-21 ステートメントハックを一度有効化した後、無効化できなくなっていた問題を修正

## contents

- [about バグベアード -bugbeard-](#about)
- [why バグベアード?](#why)
- [ログ出力サンプル](#sample)
- [使用方法](#how-to-use)
- ["悪魔の契約" -EVIL CONTRACT-](#evil-contract)
- [サンプルコード](#tutorial)
- ["Hello, Bugbeard!"](#step1)
- [Windows用情報収集サンプル](#step2)
- [.tsv形式ログ出力&マルチスレッドサンプル](#step3)
- [バルクログ出力サンプル](#step4)
- [プロファイル&カバレッジ測定サンプル](#step5)
- [リファレンス](#reference)
- [ステートメントハックによってマクロ置換されるステートメント](#statements)
- [マクロ](#macros)
- [名前空間](#namespace)
- [型](#types)
- [関数](#functions)
- [プロファイルデータの項目](#profile-columns)
- [ダウンロード](#download)
- [バグベアード入門](#primer)
- [links](#links)

## why バグベアード?

なぜ、ビ○ルダーでもゲイザーでもスズキドゲザエモンでもアスコモイドでもスカイラインでもなくバグベアードなのか? それはもちろん "不具合"という意味と "盗聴器" という意味を持つ "bug" をその名に含むからです。って、そーじゃなくて、なぜ、デバッガじゃなく良識あるプログラマには一般的に悪しき事とされる printf デバッギング用ロガーであるバグベアドなのか? ということについて少々説明しておきます。

最初に断っておきますが、「バグベアードがあればデバッガは不要」などと言うつもりもありませんし、情報収集のアスペクトが直交する(※)関係になるのでむしろデバッギングツールとしては相補する関係になると考えます。

> ※ある瞬間のシステム全体の情報...いわば空間に対して強いデバッガと、時間に対して強いバグベアードはその情報収集のアスペクトが直交します。

デバッガにはデバッギングの為のツールとしてはあまり頂けない次のような問題があります。


見ようとしたものしか見えない。


デバッガによるデバッグでは一般的にプログラマ自身が見ようとした情報しか得られません。プログラマが見ようとした情報の直近であからさまにおかしい挙動があってもプログラマにはそれが伝わらないのです。これでは目隠しされて手探りしているようなものです。
多くの場合、デバッガを利用してのデバッグではバグの原因を突き止めるに足る決定的なポイントを捕らえる必要があるにも関わらず、そのポイントを捕らえる為の情報はこのような手探りで積み重ねていかねばなりません。

処理の流れを把握しづらい。


デバッガにはステップ実行や逆実行などの機能もありますが、それでもデバッガでは常にある特定の瞬間のデータしか扱えず、これではなかなか処理の流れを把握できません。
この為、ステップ実行をやってる最中に明らかにおかしい分岐に入ってもそれがその時に注意を傾けているポイントでなければうっかり見過ごしてしまうのも無理のないことです。
また、処理の流れが可視化されていない為、デバッガでは正常な場合の処理の流れと異常な場合の処理の流れの比較に困難がつきまといます。

エンドユーザ環境では無力。


特定のエンドユーザ環境でしか再現しないバグというのは普通によくある話であるにも関わらずデバッガはこの種の再現条件を抱えるバグに対して全く無力です。

他のも問題はあるでしょうがこれらの問題に対しバグベアードでは次のようになります。


見ようとしたもの以外の情報も見える。


裏を返せば見たくもないものを見せられたり肝心な情報がその他の情報に埋もれてしまうリスクもあるわけですが、バグベアードでは意識して見ようとした以外の情報も見える為、バグの痕跡を発見しやすくなります。

処理の流れを把握しやすい。


特にツリー形式のログでは処理の流れを把握しやすく、テキストデータの形になっているので正常の場合の処理の流れと異常な場合の処理の流れの比較も容易です。

エンドユーザ環境でも利用可能。


エンドユーザにログ上のソースコード断片を見られてしまったり、膨大なログをどうやってエンドユーザに送り返してもらうのかで困ったりすることはあるかもしれませんが、エンドユーザ環境であってもバグベアードは利用できます。

またバグベアードを利用すればソースコード修正後の動作確認もステップ実行の代わりにただ実行してログを確認するだけで済ませるというお手軽なスタイルを採用することもできます。

バグベアード固有の問題についても以下に挙げておきます。


ログがでかすぎ。


『とにかくログでかすぎ。時間あたりのログ出力量が動画ファイルを余裕で上回るとかね、もう馬鹿?って感じ。』
『エンドユーザ環境でも利用可能?こんなでかいログどうやってユーザから送ってもらうのよ?』
...とでも言いたくなるようなログ出力量になり、バグベアードを利用してのデバッグはバグの原因を特定する為に必要なほんの数行を見つけ出す為に数十万行のログを追いかけるようなものとなります。
そのログのサイズは時には数百万行あるいは数千万行以上の非常に膨大なサイズに達することでしょう。
バグベアードは昨今のPCの強力なパワーがあって初めて実用的なデバッグの手段となり得ます。

ソースコード漏洩


断片的ではあるのですが相当量のソースコードがログに含まれます。
エンドユーザ環境などでテストしてもらった際にソースコードが漏洩するリスクを考慮する必要があります。

バグベアードをロードしていると実行形式ファイルが馬鹿でかくなる。


ログの膨大さに比べれば全然カワイイものですが、バグベアードをロードしていると実行形式ファイルが馬鹿でかくなります。
大きすぎてメールの添付ファイルで送れなくて困るといったこともあるかもしれません。

> バグベアードにより出力されたログを追跡してデバッグする際は高速な検索ができるビューア(テキストエディタ)を使用することを強く推奨します。
> バグベアードが出力するログは非常に膨大になりますので検索性能の差が残酷なまでに現れます。
> 例えば、約200MBのログの末尾に現れる文字列を [Notepad++](http://notepad-plus.sourceforge.net/uk/site.htm) で検索したところ約 3 分 30 秒もかかってしまいましたが、同じ環境下で[サクラエディタ](http://sakura-editor.sourceforge.net/)で検索すれば 2 秒もかかりませんでした。その性能差は実に100倍以上にすら及びます。


## ログ出力サンプル

```txt
┌──────────────────────────────────────
│日付&時刻:2008-02-24(日) 23:26:11.874
└─────┬────────────────────────────────
23:26:11.874├┬▽if (1 < current) == true; <tree.cpp>#104
23:26:11.874│├・while (1 < current) == true; <tree.cpp>#109
23:26:11.874│├┬▽if (current %p) == true; <tree.cpp>#111
23:26:11.874││├┬▽if (pn) == false; <tree.cpp>#113
23:26:11.874│││└△if (pn) == false; <tree.cpp>#113
23:26:11.874││├・p(0x00D8FC5C) = 3(0x00000003) <tree.cpp>#126
23:26:11.874││└△if (current %p) == true; <tree.cpp>#111
23:26:11.874│├・while (1 < current) == true; <tree.cpp>#109
23:26:11.874│├┬▽if (current %p) == true; <tree.cpp>#111
23:26:11.874││├┬▽if (pn) == false; <tree.cpp>#113
23:26:11.874│││└△if (pn) == false; <tree.cpp>#113
23:26:11.874││├・p(0x00D8FC5C) = 5(0x00000005) <tree.cpp>#126
23:26:11.874││└△if (current %p) == true; <tree.cpp>#111
23:26:11.874│├・while (1 < current) == true; <tree.cpp>#109
23:26:11.874│├┬▽if (current %p) == true; <tree.cpp>#111
23:26:11.874││├┬▽if (pn) == false; <tree.cpp>#113
23:26:11.874│││└△if (pn) == false; <tree.cpp>#113
```

## 使用方法

いくつかのマクロを適宜定義し、bug.h をしかるべき場所で include しコンパイルするだけです。詳細についてはこのページの情報に一通り目を通してください。

## "悪魔の契約" -EVIL CONTRACT-

邪道な技術により構築されたバグベアードは邪悪で忌むべき存在です。
またバグベアードの肝であるステートメントハックにより、さながらナノマシンの如くバグベアードのコードはユーザプログラムを隅々まで侵食します。
故にバグベアードの利用にあたっては以下のような注意が必要となります。


規格違反


バグベアードは「ステートメントのマクロでの置換」という最上級の規格違反を犯しています。
これによりバグベアードを利用したプログラムはあらゆる C++ コンパイラでの動作保証は得られなくなります。
ただし、これはバグベアードの「ステートメントハック」が有効になっている場合の話であり、バグベアードがロードされていない状態を含め「ステートメントハック」が無効になっている場合はその限りではありません。
そして通常、リリース版のプログラムではバグベアードをロードしないことをオススメします。


エラー情報の侵食


ユーザプログラムを隅々まで侵食するバグベアードのログ出力コードの影響により、エラー情報(Win32API の GetLastError()で得られるエラーコードやグローバル変数に保持されるC/C++標準ライブラリのエラーコード)が上書きされてしまう可能性があります。
前項と同様にこれはバグベアードをロードしている状態でのみ発生しうる問題であり、バグベアードをロードしていない状態であればこの問題は発生しません。


構文の制限


バグベアードのステートメントハックの実装の都合より...

```c++
if (int i = func) ...
switch(int i = func) ...
while(int i = func) ...
```

...のような形でステートメントに属する丸カッコで囲まれた箇所で変数を定義することができません。また...

```c++
void func(...) throw(...);
```

...のような例外仕様構文が一切使えません。
ただし、 `for` ステートメントに関してはこの例外となり `for(int i = 0;...` などとしても問題ありません。
また、そもそもステートメントハックを適用しない箇所ではこの制限はありません。


動作不安定


バグベアードはオブジェクトの破棄のタイミングや `operator` や `template` 等がコンパイラによって意図通りに適用されるかどうかに強く依存する為、こちらで動作確認を行っていないコンパイラではあまり意図通りに機能することを期待できませんし、動作確認を行っているコンパイラでもバージョンによっては意図通りに機能しないかもしれません。


出力ログの変形


前項と同じく、バグベアードはオブジェクトの破棄のタイミングや `operator` や `template` 等がコンパイラによって意図通りに適用されるかどうかに強く依存する為、必ずしもは理想的な形でログを出力できない為に同じソースからコンパイルされたプログラムの出力ログがコンパイラ及びそのバージョンの違いにより変形してしまうことがあります。
具体的には `return` ステートメントのログ出力は `return fucn();` のような場合、`func()` 関数の呼び出しが終了した段階で `return` ステートメントのログを出力するのが理想的ですが、そのような形で実装できない処理系では `func();` 関数の呼び出しの前に `return` ステートメントのログ出力が行われます。
また別の例では `switch` ステートメントに対してはスコープ扱いでログを出力するのが理想的ですが、そのように実装できない処理系では `switch` ステートメントがスコープ扱いされません。


過剰な警告(ある意味、真っ当な警告)


バグベアードをロードしてコンパイルを行うとバグベアードを利用していなければ表示されることはないような警告が過剰に表示されることがあります。
これは通常、無視して構いません。
ただし、バグベアードをロードしていない時に表示される警告は通常通りに対処してください。


順序不安定


シングルプロセス×シングルスレッドでバグベアードを利用する場合は関係ない話ですが、マルチプロセスもしくはマルチスレッドでバグベアードを利用する場合、複数のプロセス/スレッドの各種処理のログは必ずしもそれらの処理が実行された順番とそのログ出力結果の順番が一致しないことがあります。
これはログに記録が残る処理が実行されてから実際にそのログ出力が行われるまでに一定時間ではないタイムラグがある為です。
もちろんこれは異なるプロセス・スレッド間での話であり、同一プロセス・スレッド上の処理が実行された順番とそのログ出力結果の順番は必ず一致します。

これらを踏まえてなお、悪魔の契約を締結するならばその意思表明として `BUG_EVIL_CONTRACT` `マクロを定義してください。BUG_EVIL_CONTRACT` はユーザプログラム全体に非常に強力な影響を及ぼすバグベアードのセーフティを解除する為のマクロです。
契約締結の暁にはバグベアードはさまざまな恩恵と災いをあなたにもたらすでしょう。

## バグベアードをご利用に当たってのヒント


バグがあった場所のログ出力の為の埋め込みは消さない。


一度、なんらかのバグ追跡の為に埋め込んだログ出力用コードは基本的には全てソースコード上に残しておくことをオススメします。
実際にバグがあった箇所の埋め込みについては特に強くオススメします。
というのもバグというのは一度直したつもりでも修正が十分でなく完全に直ってなかったり、別のバグを埋め込んでしまったりというのもよくある話です。
また、バグというのは特定箇所に集中する傾向もあります。
この為、その時目的としていたバグの直しが完了した後も、バグ追跡の為に埋め込んだログ出力用コードは全てソースコード上に残しておくことをオススメします。
ログ出力量が過剰になってしまう場合は条件ディレクティブを使って必要な時以外は無効にしておくのがよいでしょう。

三項演算子のかわりに `if` を使用する。


通常であればむしろ三項演算子が適用できる場面であれば `if` の使用を控えるといったことが推奨されるかもしれませんが、あえて if を使用することで、バグベアード(のステートメントハック)で条件の判定結果を簡単にログに残せます。

明記が不要な場合でも `return` を記述する。


戻り型が `void` の関数やコンストラクタ、デストラクタでも return を記述しておくとその分ログ出力が増え、バグ追跡に役立ちます。

フィルタ機能を利用する。


マルチプロセス及びマルチスレッドによるログ出力を同じファイル等に対して行うと、特に tree 形式でのログ出力は追跡中のログが他のプロセス及び他のスレッドによる出力とごちゃ混ぜになって追跡し辛くなることがありますが、その場合は適宜そのログの表示に使ってるエディタもしくはビューアが有するフィルタ機能を使い、プロセスIDやスレッドIDで表示を絞り込むとよいでしょう。

デバッグ以外での利用。


バグベアードには環境および処理系にあまり依存せずに使えるスマートポインタ、スレッドローカルストレージ、ミューテックス等々さまざま機能を内包していますのでちょっとしたプログラムでそれらの機能を利用するのもよいでしょう。

Excel を *.tsv ログのビューアとして使用する場合は Excel2007 以降で。


Excel2003 以前では 65,536 行までしか扱えない為、極小規模なプログラムのログならどうにかなるかもしれませんが、かなり厳しいです。
Excel2007 以降であれば、1,048,576行まで扱えます。
...それでもプログラムによっては全然足りないでしょうが。

## サンプルコード

- ["Hello, Bugbeard!"](#step1)
- [Windows用情報収集サンプル](#step2)
- [.tsv形式ログ出力&マルチスレッドサンプル](#step3)
- [バルクログ出力サンプル](#step4)
- [プロファイル&カバレッジ測定サンプル](#step5)


### "Hello, Bugbeard!"

#### サンプルコード

```c++
/******************************************************************************
バグベアード -bugbeard-
サンプル "simple.cpp" ソースファイル
Coded by Wraith in Feb 18, 2007.
*****************************************************************************/

///////////////////////////////////////////////////////////////////////////////
//
// includes
//

#include
#include

///////////////////////////////////////////////////////////////////////////////
//
// [BUG]bugbeard
//

#if defined(NDEBUG)
#define BUG_DISABLE_BUGBEARD // リリース版ではバグベアードをロードしない
#endif

#define BUG_EVIL_CONTRACT // "悪魔の契約"
#include "bug.h" // ロガーを定義する為にステートメントハックを有効にしない状態で include

// 標準エラーにツリー形式の出力を行うロガーの定義
BUG_define_logger(new bugbeard::bug_tree_logger(new bugbeard::bug_file_writer_base(stderr)));

#define BUG_STATEMENT_HACK // ステートメントハックの設定
#include "bug.h" // ステートメントハックを有効にする為、再度 include

///////////////////////////////////////////////////////////////////////////////
//
// user codes
//

int main(int argc, char args[])
{
argc, args; // 警告除け

// [BUG]固定メッセージをログ出力
BUG_puts("Hello, Bugbeard!");

// [BUG]コンパイル情報のログ出力
BUG_exec(bugbeard::bug_compile_info(BUG_LOG));

// [BUG]コマンドライン引数のログ出力
BUG_exec(bugbeard::bug_arg_info(BUG_LOG, argc, args));

// [BUG]変数をログ出力
BUG_puts(BUG_VAL(args[0]));

// [BUG]書式付ログ出力
BUG_puts(BUG_FORM("このプログラムのファイル名:"%s"", args[0]));

return EXIT_SUCCESS;
}

/******************************************************************************
□■□■ Wraith the Trickster □■□■
■□■□ ~I'll go with heaven's advantage and fool's wisdom.~ ■□■□
******************************************************************************/
```

#### 出力結果(標準エラー)

```txt
┌──────────────────────────────────────
│日付&時刻:2008-02-24(日) 18:06:13.739
└─────┬────────────────────────────────
18:06:13.743├・Hello, Bugbeard! <sample/simple.cpp>#46
18:06:13.744├┬▽Compile Information <bug.h>#2839
18:06:13.745│├・Compiler:Borland C++(0x0564) <bug.h>#2841
18:06:13.745│├・Compile Date:Feb 24 2008 / Compile Time:18:06:11 <bug.h>#2843
18:06:13.746│└△Compile Information <bug.h>#2839
18:06:13.747├┬▽Commandline Argument Information <bug.h>#2849
18:06:13.748│├・argc(0x0012F994) = 1(0x00000001) <bug.h>#2850
18:06:13.749│├・args[0]:o:\cxx\bugbeard\simple.exe <bug.h>#2853
18:06:13.750│└△Commandline Argument Information <bug.h>#2849
18:06:13.751├・args[0](0x00DE21C4) = "o:\cxx\bugbeard\simple.exe" <sample/simple.cpp>#55
18:06:13.752├・このプログラムのファイル名:"o:\cxx\bugbeard\simple.exe" <sample/simple.cpp>#58
18:06:13.753├・return <sample/simple.cpp>#60
┌─────┴────────────────────────────────
│日付&時刻:2008-02-24(日) 18:06:13.754
└──────────────────────────────────────
```

#### 解説

このサンプルでの一番の肝は...

```c++
///////////////////////////////////////////////////////////////////////////////
//
// [BUG]bugbeard
//

#if defined(NDEBUG)
#define BUG_DISABLE_BUGBEARD // リリース版ではバグベアードをロードしない
#endif

#define BUG_EVIL_CONTRACT // "悪魔の契約"
#include "bug.h" // ロガーを定義する為にステートメントハックを有効にしない状態で include

// 標準エラーにツリー形式の出力を行うロガーの定義
BUG_define_logger(new bugbeard::bug_tree_logger(new bugbeard::bug_file_writer_base(stderr)));

#define BUG_STATEMENT_HACK // ステートメントハックの設定
#include "bug.h" // ステートメントハックを有効にする為、再度 include
```

...この部分ですが、まぁ、最初は所謂 "おまじない" の類だとでも思ってください。

`BUG_define_logger()` の行によりログの出力形式等を指定しています。

`NDEBUG` マクロが定義された場合の `assert()` マクロと同様に、`BUG_DISABLE_BUGBEARD` マクロが定義されると `BUG_*` な命名になっているコードは全て消え去ります。

なお、Windowsではデフォルトで標準エラーがアスキーモードになっている為、改行コード `"\r\n"` が無駄に拡張され `"\r\r\n"` になってしまうので標準エラーをファイルへリダイレクトすると不格好になります。Windowsでは `bugbeard::bug_file_writer` で直接ファイルに出力するか、`bugbeard::bug_OutputDebugString_writer` で `OutputDebugString()` で出力することを推奨します。


### Windows用情報収集サンプル

#### サンプルコード

```c++
/******************************************************************************
バグベアード -bugbeard-
サンプル "win.cpp" ソースファイル
Coded by Wraith in Feb 18, 2007.
******************************************************************************/

///////////////////////////////////////////////////////////////////////////////
//
// includes
//

#include
#include

///////////////////////////////////////////////////////////////////////////////
//
// [BUG]bugbeard
//

#if defined(NDEBUG)
#define BUG_DISABLE_BUGBEARD // リリース版ではバグベアードをロードしない
#endif

#define BUG_EVIL_CONTRACT // "悪魔の契約"
#include "bug.h" // ロガーを定義する為にステートメントハックを有効にしない状態で include

// OutputDebugString() でツリー形式の出力を行うロガーの定義
BUG_define_logger(new bugbeard::bug_tree_logger(new bugbeard::bug_OutputDebugString_writer()));

#define BUG_STATEMENT_HACK // ステートメントハックの設定
#include "bug.h" // ステートメントハックを有効にする為、再度 include

///////////////////////////////////////////////////////////////////////////////
//
// user codes
//

int main(int argc, char *args[])
{
argc, args; // 警告除け

puts("このサンプルでは Win32API の OutputDebugString() でログを出力しています。");
puts("ご利用のIDEのデバッグ出力表示機能や [sysinternals の DebugView](http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx) などで出力内容を確認できます。");

// [BUG]コンパイル情報のログ出力
BUG_exec(bugbeard::bug_compile_info(BUG_LOG));

// [BUG]コマンドライン引数のログ出力
BUG_exec(bugbeard::bug_arg_info(BUG_LOG, argc, args));

// [BUG]Windowsバージョン情報のログ出力
BUG_exec(bugbeard::bug_windows_version_info(BUG_LOG));

// [BUG]Windowsシステム情報のログ出力
BUG_exec(bugbeard::bug_windows_system_info(BUG_LOG));

#if 0x0500 <= WINVER
// 各種モジュールバージョン情報のログ出力
BUG_exec(bugbeard::bug_enum_module_version_info(BUG_LOG));
#endif

#if 0x0500 <= WINVER
// 各種モジュールハッシュ値のログ出力
BUG_exec(bugbeard::bug_enum_module_hash(BUG_LOG));
#endif

#if 0x0500 <= WINVER
// [BUG]メモリ情報のログ出力
BUG_exec(bugbeard::bug_memory_info(BUG_LOG));
#endif

// [BUG]ドライブ情報のログ出力
BUG_exec(bugbeard::bug_enum_drive_info(BUG_LOG));

#if 0x0500 <= WINVER
// [BUG]モニター情報のログ出力
BUG_exec(bugbeard::bug_enum_monitor_info(BUG_LOG));
// [BUG]ディスプレイ情報のログ出力
BUG_exec(bugbeard::bug_enum_display_info(BUG_LOG));
#endif

// [BUG](全ての)環境変数情報のログ出力
BUG_exec(bugbeard::bug_enum_env(BUG_LOG));

return EXIT_SUCCESS;
}

/******************************************************************************
□■□■ Wraith the Trickster □■□■
■□■□ ~I'll go with heaven's advantage and fool's wisdom.~ ■□■□
******************************************************************************/
```

#### 出力結果(標準出力)

```txt
このサンプルでは Win32API の OutputDebugString() でログを出力しています。
ご利用のIDEのデバッグ出力表示機能や [sysinternals の DebugView](http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx) などで出力内容を確認できます。
```

#### 出力結果(OutputDebugString())

> ※意図的に一部編集してます。

```txt
┌──────────────────────────────────────
│日付&時刻:2008-09-23(火) 22:06:59.771
└─────┬────────────────────────────────
22:06:59.772├┬▽Compile Information #4450
22:06:59.772│├・Compiler:Borland C++(0x0564) #4452
22:06:59.772│├・Compile Date:Sep 23 2008 / Compile Time:22:06:25 #4454
22:06:59.772│└△Compile Information #4450
22:06:59.772├┬▽Commandline Argument Information #4461
22:06:59.772│├・argc(0x0012D500) = 1(0x00000001) #4462
22:06:59.772│├・args[0]:O:\cxx\bugbeard\work\win.exe #4465
22:06:59.772│└△Commandline Argument Information #4461
22:06:59.773├┬▽Windows Version Information #4505
22:06:59.773│├・Microsoft Windows Vista Business Edition, 32-bit #4508
22:06:59.773│├・OSVERSIONINFO dwMajorVersion:6 / dwMinorVersion:0 / dwBuildNumber:6001 / dwPlatformId:2 / szCSDVersion:Service Pack 1 #4510
22:06:59.773│├・OSVERSIONINFOEX wServicePackMajor:1 / wServicePackMinor:0 / wSuiteMask:256 / wProductType:1 / wReserved:30 #4514
22:06:59.773│└△Windows Version Information #4505
22:06:59.773├┬▽Windows System Information #4474
22:06:59.773│├・wProcessorArchitecture:0 #4488
22:06:59.773│├・wReserved:0 #4489
22:06:59.773│├・dwPageSize:4096 #4490
22:06:59.773│├・lpMinimumApplicationAddress:00010000 #4491
22:06:59.773│├・lpMaximumApplicationAddress:7FFEFFFF #4492
22:06:59.773│├・dwActiveProcessorMask:3 #4493
22:06:59.773│├・dwNumberOfProcessors:2 #4494
22:06:59.773│├・dwProcessorType:586 #4495
22:06:59.773│├・dwAllocationGranularity:65536 #4496
22:06:59.773│├・wProcessorLevel:6 #4497
22:06:59.773│├・wProcessorRevision:3846 #4498
22:06:59.773│└△Windows System Information #4474
22:06:59.773├┬▽Module Version Information #4591
22:06:59.773│├・module:"O:\cxx\bugbeard\work\win.exe" / no version information #4584
22:06:59.773│├・module:"C:\Windows\system32\ntdll.dll" / language:041104b0 / FileDescription: NT レイヤ DLL / FileVersion: 6.0.6001.18000 (longhorn_rtm.080118-1840) / ProductName: MicrosoftR WindowsR Operating System / ProductVersion: 6.0.6001.18000 / CompanyName: Microsoft Corporation / OriginalFilename: ntdll.dll.mui #4577
22:06:59.774│├・module:"C:\Windows\system32\kernel32.dll" / language:041104b0 / FileDescription: Windows NT ベース API クライアント DLL / FileVersion: 6.0.6001.18000 (longhorn_rtm.080118-1840) / ProductName: MicrosoftR WindowsR Operating System / ProductVersion: 6.0.6001.18000 / CompanyName: Microsoft Corporation / OriginalFilename: kernel32 #4577
22:06:59.774│├・module:"C:\Windows\system32\ADVAPI32.DLL" / language:041104b0 / FileDescription: Advanced Windows 32 ベース API / FileVersion: 6.0.6001.18000 (longhorn_rtm.080118-1840) / ProductName: MicrosoftR WindowsR Operating System / ProductVersion: 6.0.6001.18000 / CompanyName: Microsoft Corporation / OriginalFilename: advapi32.dll.mui #4577
22:06:59.774│├・module:"C:\Windows\system32\RPCRT4.dll" / language:041104b0 / FileDescription: リモート プロシージャ コール ランタイム / FileVersion: 6.0.6001.18000 (longhorn_rtm.080118-1840) / ProductName: MicrosoftR WindowsR Operating System / ProductVersion: 6.0.6001.18000 / CompanyName: Microsoft Corporation / OriginalFilename: rpcrt4.dll.mui #4577
22:06:59.774│├・module:"C:\Windows\system32\VERSION.DLL" / language:040904b0 / FileDescription: Version Checking and File Installation Libraries / FileVersion: 6.0.6001.18000 (longhorn_rtm.080118-1840) / ProductName: MicrosoftR WindowsR Operating System / ProductVersion: 6.0.6001.18000 / CompanyName: Microsoft Corporation / OriginalFilename: VERSION.DLL #4577
22:06:59.774│├・module:"C:\Windows\system32\msvcrt.dll" / language:040904b0 / FileDescription: Windows NT CRT DLL / FileVersion: 7.0.6001.18000 (longhorn_rtm.080118-1840) / ProductName: MicrosoftR WindowsR Operating System / ProductVersion: 7.0.6001.18000 / CompanyName: Microsoft Corporation / OriginalFilename: msvcrt.dll #4577
22:06:59.775│├・module:"C:\Windows\system32\USER32.DLL" / language:041104b0 / FileDescription: マルチユーザー Windows ユーザー API クライアント DLL / FileVersion: 6.0.6001.18000 (longhorn_rtm.080118-1840) / ProductName: MicrosoftR WindowsR Operating System / ProductVersion: 6.0.6001.18000 / CompanyName: Microsoft Corporation / OriginalFilename: user32 #4577
22:06:59.775│├・module:"C:\Windows\system32\GDI32.dll" / language:040904b0 / FileDescription: GDI Client DLL / FileVersion: 6.0.6001.18023 (vistasp1_gdr.080221-1537) / ProductName: MicrosoftR WindowsR Operating System / ProductVersion: 6.0.6001.18023 / CompanyName: Microsoft Corporation / OriginalFilename: gdi32 #4577
22:06:59.775│├・module:"C:\Windows\system32\PSAPI.DLL" / language:040904b0 / FileDescription: Process Status Helper / FileVersion: 6.0.6000.16386 (vista_rtm.061101-2205) / ProductName: MicrosoftR WindowsR Operating System / ProductVersion: 6.0.6000.16386 / CompanyName: Microsoft Corporation / OriginalFilename: PSAPI #4577
22:06:59.775│├・module:"C:\Windows\system32\IMM32.DLL" / language:040904b0 / FileDescription: Multi-User Windows IMM32 API Client DLL / FileVersion: 6.0.6001.18000 (longhorn_rtm.080118-1840) / ProductName: MicrosoftR WindowsR Operating System / ProductVersion: 6.0.6001.18000 / CompanyName: Microsoft Corporation / OriginalFilename: imm32 #4577
22:06:59.775│├・module:"C:\Windows\system32\MSCTF.dll" / language:041104b0 / FileDescription: MSCTF サーバー DLL / FileVersion: 6.0.6000.16386 (vista_rtm.061101-2205) / ProductName: MicrosoftR WindowsR Operating System / ProductVersion: 6.0.6000.16386 / CompanyName: Microsoft Corporation / OriginalFilename: MSCTF.DLL.MUI #4577
22:06:59.776│├・module:"C:\Windows\system32\LPK.DLL" / language:040904b0 / FileDescription: Language Pack / FileVersion: 6.0.6001.18000 (longhorn_rtm.080118-1840) / ProductName: MicrosoftR WindowsR Operating System / ProductVersion: 6.0.6001.18000 / CompanyName: Microsoft Corporation / OriginalFilename: LanguagePack #4577
22:06:59.776│├・module:"C:\Windows\system32\USP10.dll" / language:040904b0 / FileDescription: Uniscribe Unicode script processor / FileVersion: 1.0626.6001.18000 (longhorn_rtm.080118-1840) / ProductName: Microsoft(R) Uniscribe Unicode script processor / ProductVersion: 1.0626.6001.18000 / CompanyName: Microsoft Corporation / OriginalFilename: Uniscribe #4577
22:06:59.776│└△Module Version Information #4591
22:06:59.776├┬▽Module Hash #4605
22:06:59.789│├・file:"O:\cxx\bugbeard\work\win.exe" / hash(MD5):DA0A29DA42E371316446BFE64A528921 #4528
22:06:59.792│├・file:"C:\Windows\system32\ntdll.dll" / hash(MD5):172E1B9EB61167AD232291A6761501BF #4528
22:06:59.796│├・file:"C:\Windows\system32\kernel32.dll" / hash(MD5):DC2338093F91BA4E0512208E60206DDD #4528
22:06:59.799│├・file:"C:\Windows\system32\ADVAPI32.DLL" / hash(MD5):C44A1766E93E506EE2102A305799E1A1 #4528
22:06:59.802│├・file:"C:\Windows\system32\RPCRT4.dll" / hash(MD5):520CE99A9C1A3B14078BB39272424652 #4528
22:06:59.802│├・file:"C:\Windows\system32\VERSION.DLL" / hash(MD5):187D588F7A1A45DE48B8540401A90850 #4528
22:06:59.805│├・file:"C:\Windows\system32\msvcrt.dll" / hash(MD5):04CBEAA089B6A752B3EB660BEE8C4964 #4528
22:06:59.808│├・file:"C:\Windows\system32\USER32.DLL" / hash(MD5):B974D9F06DC7D1908E825DC201681269 #4528
22:06:59.809│├・file:"C:\Windows\system32\GDI32.dll" / hash(MD5):F77456EB036D834BFBC700EB2414879E #4528
22:06:59.810│├・file:"C:\Windows\system32\PSAPI.DLL" / hash(MD5):93A1732F7F997E36A5C3893539E2FF02 #4528
22:06:59.811│├・file:"C:\Windows\system32\IMM32.DLL" / hash(MD5):EC17194A193CD8E90D27CFB93DFA9A2E #4528
22:06:59.814│├・file:"C:\Windows\system32\MSCTF.dll" / hash(MD5):030981927E732FD4013910B3B06BD45B #4528
22:06:59.815│├・file:"C:\Windows\system32\LPK.DLL" / hash(MD5):DD496299B7351E16E602FC4299345A33 #4528
22:06:59.817│├・file:"C:\Windows\system32\USP10.dll" / hash(MD5):3122DAF86B33ED8AC4662D07593025D7 #4528
22:06:59.817│└△Module Hash #4605
22:06:59.817├┬▽Memory Information #4623
22:06:59.817│├・load:61% #4628
22:06:59.817│├・TotalPhys:2.98GiByte(3201634304) #4629
22:06:59.817│├・AvailPhys:1.14GiByte(1222332416) #4630
22:06:59.817│├・Used-Phys:1.84GiByte(1979301888) #4631
22:06:59.817│├・TotalPageFile:6.16GiByte(6611963904) #4632
22:06:59.817│├・AvailPageFile:1.14GiByte(1222332416) #4633
22:06:59.817│├・Used-PageFile:5.02GiByte(5389631488) #4634
22:06:59.817│├・TotalVirtual:2.00GiByte(2147352576) #4635
22:06:59.817│├・AvailVirtual:1.14GiByte(1222332416) #4636
22:06:59.817│├・Used-Virtual:882MiByte(925020160) #4637
22:06:59.817│├・AvailExtendedVirtual:0Byte(0) #4638
22:06:59.817│└△Memory Information #4623
22:06:59.817├┬▽Drives Information #4752
22:06:59.817│├・drive:C / type:fixed / label:***** / file-system:NTFS / serial:0x******** / max-path:255 / flags:0x002700FF / sectors-per-cluster:8 / bytes-per-sector:512Byte / available:6.08GiByte(6528913408) / total:74.5GiByte(80003198976) / free:6.08GiByte(6528913408) #4747
22:06:59.818│├・drive:D / type:fixed / label:** / file-system:NTFS / serial:0x******** / max-path:255 / flags:0x002700FF / sectors-per-cluster:8 / bytes-per-sector:512Byte / available:39.0GiByte(41832468480) / total:74.5GiByte(80007262208) / free:39.0GiByte(41832468480) #4747
22:06:59.818│├・drive:F / type:fixed / label:*** / file-system:NTFS / serial:0x******** / max-path:255 / flags:0x002700FF / sectors-per-cluster:8 / bytes-per-sector:512Byte / available:726GiByte(779961614336) / total:931GiByte(1000202240000) / free:726GiByte(779961614336) #4747
22:06:59.819│├・drive:G / type:cdrom #4747
22:06:59.831│├・drive:I / type:removable #4747
22:06:59.842│├・drive:J / type:removable #4747
22:06:59.854│├・drive:K / type:removable #4747
22:06:59.866│├・drive:L / type:removable #4747
22:06:59.866│├・drive:O / type:fixed / label:**** / file-system:NTFS / serial:0x******** / max-path:255 / flags:0x002700FF / sectors-per-cluster:8 / bytes-per-sector:512Byte / available:10.4GiByte(11172679680) / total:114GiByte(122683387904) / free:10.4GiByte(11172679680) #4747
22:06:59.866│├・drive:X / type:fixed / label:***** / file-system:NTFS / serial:0x******** / max-path:255 / flags:0x002700FF / sectors-per-cluster:8 / bytes-per-sector:512Byte / available:143GiByte(154588205056) / total:202GiByte(217409646592) / free:143GiByte(154588205056) #4747
22:06:59.866│└△Drives Information #4752
22:06:59.866├┬▽Monitor Information #4793
22:06:59.866│├・Monitor Rect:(0,0)-(1920,1200) / Work:(0,0)-(1920,1200) / Device:\\.\DISPLAY1 #4786
22:06:59.866│├・Monitor Rect:(1920,176)-(3200,1200) / Work:(1920,176)-(3200,1200) / Device:\\.\DISPLAY2 #4786
22:06:59.866│└△Monitor Information #4793
22:06:59.866├┬▽Display Information #4851
22:06:59.866│├・Display Name:\\.\DISPLAY1 / Context:NVIDIA GeForce 8600 GTS #4867
22:06:59.867│├・Display Name:\\.\DISPLAY2 / Context:NVIDIA GeForce 8600 GTS #4867
22:06:59.867│├・Display Name:\\.\DISPLAYV1 / Context:RDPDD Chained DD #4867
22:06:59.867│├・Display Name:\\.\DISPLAYV2 / Context:RDP Encoder Mirror Driver #4867
22:06:59.867│└△Display Information #4851
22:06:59.867├┬▽All Environment Information #4838
22:06:59.867│├・=::=::\ #4842
22:06:59.867│├・=C:=C:\Users\wraith #4842
22:06:59.867│├・=ExitCode=00000000 #4842
22:06:59.867│├・=O:=O:\cxx\bugbeard\work #4842
22:06:59.867│├・ALLUSERSPROFILE=C:\ProgramData #4842
22:06:59.867│├・APPDATA=C:\Users\wraith\AppData\Roaming #4842
22:06:59.867│├・BDSCOMMONDIR=C:\Users\Public\Documents\RAD Studio\5.0 #4842
22:06:59.867│├・CLASSPATH=.;C:\Program Files\Java\jre1.5.0_10\lib\ext\QTJava.zip #4842
22:06:59.867│├・CommonProgramFiles=C:\Program Files\Common Files #4842
22:06:59.867│├・COMPUTERNAME=CRUISER #4842
22:06:59.867│├・ComSpec=C:\Windows\system32\cmd.exe #4842
22:06:59.867│├・FP_NO_HOST_CHECK=NO #4842
22:06:59.867│├・HOMEDRIVE=C: #4842
22:06:59.867│├・HOMEPATH=\Users\wraith #4842
22:06:59.867│├・LOCALAPPDATA=C:\Users\wraith\AppData\Local #4842
22:06:59.867│├・LOGONSERVER=\\CRUISER #4842
22:06:59.867│├・NUMBER_OF_PROCESSORS=2 #4842
22:06:59.867│├・OS=Windows_NT #4842
22:06:59.867│├・Path=************************************************************************************************************************* #4842
22:06:59.867│├・PATHEXT=**************************************************** #4842
22:06:59.867│├・PROCESSOR_ARCHITECTURE=x86 #4842
22:06:59.867│├・PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 6, GenuineIntel #4842
22:06:59.868│├・PROCESSOR_LEVEL=6 #4842
22:06:59.868│├・PROCESSOR_REVISION=**** #4842
22:06:59.868│├・ProgramData=C:\ProgramData #4842
22:06:59.868│├・ProgramFiles=C:\Program Files #4842
22:06:59.868│├・PROMPT=$P$G #4842
22:06:59.868│├・PUBLIC=C:\Users\Public #4842
22:06:59.868│├・QTJAVA=C:\Program Files\Java\jre1.5.0_10\lib\ext\QTJava.zip #4842
22:06:59.868│├・SESSIONNAME=Console #4842
22:06:59.868│├・solomoncmd="O:\solomon\bcc32" win.cpp #4842
22:06:59.868│├・SystemDrive=C: #4842
22:06:59.868│├・SystemRoot=C:\Windows #4842
22:06:59.868│├・TEMP=C:\Users\wraith\AppData\Local\Temp #4842
22:06:59.868│├・TMP=C:\Users\wraith\AppData\Local\Temp #4842
22:06:59.868│├・UGII_3DCONNEXION_LIBRARY=%UGII_BASE_DIR%\ugalliance\vendor\startup\3DxNX.dll #4842
22:06:59.868│├・USERDOMAIN=cruiser #4842
22:06:59.868│├・USERNAME=wraith #4842
22:06:59.868│├・USERPROFILE=C:\Users\wraith #4842
22:06:59.868│├・windir=C:\Windows #4842
22:06:59.868│└△All Environment Information #4838
22:06:59.868├・return #88
┌─────┴────────────────────────────────
│日付&時刻:2008-09-23(火) 22:06:59.868
└──────────────────────────────────────
```

#### 解説

```c++
// OutputDebugString() でツリー形式の出力を行うロガーの定義
BUG_define_logger(new bugbeard::bug_tree_logger(new bugbeard::bug_OutputDebugString_writer()));
```

...この指定により標準エラーへの出力ではなく OutputDebugString() を使ってのログ出力を行っています。
[DebugView](http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx) などでログ出力を確認できます。
上のようなログ出力結果は一見、過剰に思えるかもしれませんが、バグベアードによって出力されるログは一般的に非常に膨大なものになり、この程度ハッキリ言って誤差の範囲ですから Windows でバグベアードを利用される場合...

```c++
// [BUG]コンパイル情報のログ出力
BUG_exec(bugbeard::bug_compile_info(BUG_LOG));

// [BUG]コマンドライン引数のログ出力
BUG_exec(bugbeard::bug_arg_info(BUG_LOG, argc, args));

// [BUG]Windowsバージョン情報のログ出力
BUG_exec(bugbeard::bug_windows_version_info(BUG_LOG));

#if 0x0500 <= WINVER
// 各種モジュールバージョン情報のログ出力
BUG_exec(bugbeard::bug_enum_module_version_info(BUG_LOG));
#endif

#if 0x0500 <= WINVER
// [BUG]メモリ情報のログ出力
BUG_exec(bugbeard::bug_memory_info(BUG_LOG));
#endif

// [BUG]ドライブ情報のログ出力
BUG_exec(bugbeard::bug_enum_drive_info(BUG_LOG));

#if 0x0500 <= WINVER
// [BUG]モニター情報のログ出力
BUG_exec(bugbeard::bug_enum_monitor_info(BUG_LOG));
// [BUG]ディスプレイ情報のログ出力
BUG_exec(bugbeard::bug_enum_display_info(BUG_LOG));
#endif

// [BUG](全ての)環境変数情報のログ出力
BUG_exec(bugbeard::bug_enum_env(BUG_LOG));
```

...この部分のコードを丸々コピペして利用されることを強く推奨いたします。


### .tsv形式ログ出力&マルチスレッドサンプル

#### サンプルコード

```c++
/******************************************************************************
バグベアード -bugbeard-
サンプル "tsv.cpp" ソースファイル
Coded by Wraith in Feb 18, 2007.
******************************************************************************/

///////////////////////////////////////////////////////////////////////////////
//
// includes
//

#include
#include
#if defined(__GNUC__)
# include
#else
# include
#endif

///////////////////////////////////////////////////////////////////////////////
//
// [BUG]bugbeard
//

#if defined(NDEBUG)
#define BUG_DISABLE_BUGBEARD // リリース版ではバグベアードをロードしない
#endif

#define BUG_EVIL_CONTRACT // "悪魔の契約"
#define BUG_MULTI_THREAD // マルチスレッドモデルでバグベアードを利用
#include "bug.h" // ロガーを定義する為にステートメントハックを有効にしない状態で include

// 共用ライターの定義
BUG_exec(bugbeard::bug_smart_writer common_writer(new bugbeard::bug_file_writer_base(stderr)));

// 標準エラーにTSV形式の出力を行うロガーの定義(メインスレッド用)
BUG_define_logger(new bugbeard::bug_tsv_logger(common_writer));

#define BUG_STATEMENT_HACK // ステートメントハックの設定
#include "bug.h" // ステートメントハックを有効にする為、再度 include

///////////////////////////////////////////////////////////////////////////////
//
// user codes
//

//
// thread
//
#if defined(BUG_MS_WINDOWS)
#define BUG_THREAD_RESULT DWORD
#define BUG_THREAD_CALL __stdcall
#define BUG_THREAD_HANDLE HANDLE
#else
#define BUG_THREAD_RESULT void *
#define BUG_THREAD_CALL
#define BUG_THREAD_HANDLE pthread_t
#endif

// スレッドの開始
BUG_THREAD_HANDLE open_thread(BUG_THREAD_RESULT (BUG_THREAD_CALL *func)(void *), void *data)
{
#if defined(BUG_MS_WINDOWS)
# if defined(__BORLANDC__) || defined(__INTEL_COMPILER) || defined(_MSC_VER)
DWORD thread_id;
return (HANDLE)_beginthreadex(NULL, 0, (unsigned (__stdcall *)(void *))func, data, 0, (unsigned int *)&thread_id);
# else
return CreateThread(NULL, 4096, func, data, 0, NULL);
# endif
#else
BUG_THREAD_HANDLE handle;
pthread_create(&handle, NULL, func, data);
return handle;
#endif
}

// スレッド終了まで待機
void wait_and_close_thread(BUG_THREAD_HANDLE handle)
{
#if defined(BUG_MS_WINDOWS)
WaitForSingleObject(handle, INFINITE);
CloseHandle(handle);
#else
pthread_join(handle, NULL);
#endif
}

//
// 素因数分解
//
#if defined(_MSC_VER) && 1300 < _MSC_VER
# pragma warning(disable:4996)
#endif
void factorize(int number)
{
char buffer[256];
char * anchor = buffer;
anchor += sprintf(anchor, "%d = ", number);
int current = number;
if (1 < current)
{
int p = 2;
int pn = 0;
int inc = 1;
while(1 < current)
{
if (current %p)
{
if (pn)
{
anchor += sprintf(anchor, "%d", p);
if (1 < pn)
{
anchor += sprintf(anchor, "^%d", pn);
}
anchor += sprintf(anchor, " * ");
pn = 0;
}
p += inc;

// [BUG]値のログ出力
BUG_puts(BUG_VAL(p));

inc = 2;
}
else
{
current /= p;

// [BUG]値のログ出力
BUG_puts(BUG_VAL(current));

++pn;

// [BUG]値のログ出力
BUG_puts(BUG_VAL(pn));
}
}
anchor += sprintf(anchor, "%d", p);
if (1 < pn)
{
anchor += sprintf(anchor, "^%d", pn);
}
}
else
{
anchor += sprintf(anchor, "%d", current);
}
puts(buffer);
return;
}
BUG_THREAD_RESULT BUG_THREAD_CALL factorize_thread(void * data)
{
// [BUG]スレッドローカルロガーの定義
BUG_define_logger(new bugbeard::bug_tsv_logger(common_writer));
factorize((int)data);
return 0;
}

//
// スタートアップ
//
int main(int argc, char * args[])
{
// [BUG]コンパイル情報のログ出力
BUG_exec(bugbeard::bug_compile_info(BUG_LOG));

// [BUG]コマンドライン引数のログ出力
BUG_exec(bugbeard::bug_arg_info(BUG_LOG, argc, args));

BUG_THREAD_HANDLE * thread_list = new BUG_THREAD_HANDLE[argc];

// スレッド起動
for(int i = 1; i < argc; ++i)
{
thread_list[i] = open_thread(factorize_thread, (void *)atoi(args[i]));
}
// スレッド待機
for(int i = 1; i < argc; ++i)
{
wait_and_close_thread(thread_list[i]);
}

delete []thread_list;

return EXIT_SUCCESS;
}

/******************************************************************************
□■□■ Wraith the Trickster □■□■
■□■□ ~I'll go with heaven's advantage and fool's wisdom.~ ■□■□
******************************************************************************/
```

#### 出力結果(標準出力)

```txt
101 = 101
301 = 7 * 43
201 = 3 * 67
```

#### 出力結果(標準エラー)

```txt
20:04:19.182 540 0 bug.h 2462 ▽bugbeard session root
20:04:19.183 540 1 bug.h 2463 日付&時刻:2008-02-24(日) 20:04:19.183
20:04:19.183 540 1 bug.h 2839 ▽Compile Information
20:04:19.183 540 2 bug.h 2841 Compiler:Visual C++(1400)
20:04:19.183 540 2 bug.h 2843 Compile Date:Feb 24 2008 / Compile Time:20:02:37
20:04:19.183 540 2 bug.h 2839 △Compile Information
20:04:19.183 540 1 bug.h 2849 ▽Commandline Argument Information
20:04:19.183 540 2 bug.h 2850 argc(0x0012FAC8) = 4(0x00000004)
20:04:19.183 540 2 bug.h 2853 args[0]:tsv
20:04:19.183 540 2 bug.h 2853 args[1]:101
20:04:19.183 540 2 bug.h 2853 args[2]:201
20:04:19.183 540 2 bug.h 2853 args[3]:301
20:04:19.183 540 2 bug.h 2849 △Commandline Argument Information
20:04:19.183 540 1 tsv.cpp 176 ▽new
20:04:19.183 540 2 tsv.cpp 176 △new
20:04:19.183 540 1 tsv.cpp 179 ▽for
20:04:19.183 540 2 tsv.cpp 69 return
20:04:19.183 5772 0 bug.h 2462 ▽bugbeard session root
20:04:19.183 540 2 tsv.cpp 69 return
20:04:19.183 5772 1 bug.h 2463 日付&時刻:2008-02-24(日) 20:04:19.183
20:04:19.183 5772 1 tsv.cpp 104 ▽if (1 < current) == true;
20:04:19.183 540 2 tsv.cpp 69 return
20:04:19.183 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.183 540 2 tsv.cpp 179 △for
20:04:19.183 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.183 540 1 tsv.cpp 184 ▽for
20:04:19.183 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.183 868 0 bug.h 2462 ▽bugbeard session root
20:04:19.183 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.183 868 1 bug.h 2463 日付&時刻:2008-02-24(日) 20:04:19.183
20:04:19.183 5772 3 tsv.cpp 126 p(0x0133FC5C) = 3(0x00000003)
20:04:19.183 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.183 868 1 tsv.cpp 104 ▽if (1 < current) == true;
20:04:19.183 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.183 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.183 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.183 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.183 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.183 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.183 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.183 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.183 5772 3 tsv.cpp 126 p(0x0133FC5C) = 5(0x00000005)
20:04:19.183 868 3 tsv.cpp 126 p(0x0143FC5C) = 3(0x00000003)
20:04:19.183 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.183 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.183 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.183 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.183 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.183 868 2 tsv.cpp 111 ▽if (current %p) == false;
20:04:19.183 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.183 868 3 tsv.cpp 135 current(0x0143FD9C) = 67(0x00000043)
20:04:19.183 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.183 868 3 tsv.cpp 140 pn(0x0143FC54) = 1(0x00000001)
20:04:19.183 5772 3 tsv.cpp 126 p(0x0133FC5C) = 7(0x00000007)
20:04:19.183 868 3 tsv.cpp 111 △if (current %p) == false;
20:04:19.184 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 4264 0 bug.h 2462 ▽bugbeard session root
20:04:19.184 868 3 tsv.cpp 113 ▽if (pn) == true;
20:04:19.184 4264 1 bug.h 2463 日付&時刻:2008-02-24(日) 20:04:19.184
20:04:19.184 868 4 tsv.cpp 116 ▽if (1 < pn) == false;
20:04:19.184 4264 1 tsv.cpp 104 ▽if (1 < current) == true;
20:04:19.184 868 5 tsv.cpp 116 △if (1 < pn) == false;
20:04:19.184 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 868 4 tsv.cpp 113 △if (pn) == true;
20:04:19.184 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.183 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.184 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.184 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.184 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 4264 3 tsv.cpp 126 p(0x0153FC5C) = 3(0x00000003)
20:04:19.184 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.184 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.184 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.184 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 5772 3 tsv.cpp 126 p(0x0133FC5C) = 9(0x00000009)
20:04:19.184 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.184 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.184 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.184 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 4264 3 tsv.cpp 126 p(0x0153FC5C) = 5(0x00000005)
20:04:19.184 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.184 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.184 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.184 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 5772 3 tsv.cpp 126 p(0x0133FC5C) = 11(0x0000000B)
20:04:19.184 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.184 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.184 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.184 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 4264 3 tsv.cpp 126 p(0x0153FC5C) = 7(0x00000007)
20:04:19.184 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.184 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.184 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.184 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 5772 3 tsv.cpp 126 p(0x0133FC5C) = 13(0x0000000D)
20:04:19.184 4264 2 tsv.cpp 111 ▽if (current %p) == false;
20:04:19.184 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.184 4264 3 tsv.cpp 135 current(0x0153FD9C) = 43(0x0000002B)
20:04:19.184 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 4264 3 tsv.cpp 140 pn(0x0153FC54) = 1(0x00000001)
20:04:19.184 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 4264 3 tsv.cpp 111 △if (current %p) == false;
20:04:19.184 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.184 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.184 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 5772 3 tsv.cpp 126 p(0x0133FC5C) = 15(0x0000000F)
20:04:19.184 4264 3 tsv.cpp 113 ▽if (pn) == true;
20:04:19.184 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.184 4264 4 tsv.cpp 116 ▽if (1 < pn) == false;
20:04:19.184 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 4264 5 tsv.cpp 116 △if (1 < pn) == false;
20:04:19.184 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 4264 4 tsv.cpp 113 △if (pn) == true;
20:04:19.184 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.184 4264 3 tsv.cpp 126 p(0x0153FC5C) = 9(0x00000009)
20:04:19.184 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.184 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.184 5772 3 tsv.cpp 126 p(0x0133FC5C) = 17(0x00000011)
20:04:19.184 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.184 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.184 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.184 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.184 4264 3 tsv.cpp 126 p(0x0153FC5C) = 11(0x0000000B)
20:04:19.184 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.184 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.184 5772 3 tsv.cpp 126 p(0x0133FC5C) = 19(0x00000013)
20:04:19.184 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.184 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.184 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.184 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 4264 3 tsv.cpp 126 p(0x0153FC5C) = 13(0x0000000D)
20:04:19.184 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 5772 3 tsv.cpp 126 p(0x0133FC5C) = 21(0x00000015)
20:04:19.185 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 126 p(0x0153FC5C) = 15(0x0000000F)
20:04:19.185 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 5772 3 tsv.cpp 126 p(0x0133FC5C) = 23(0x00000017)
20:04:19.185 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 126 p(0x0153FC5C) = 17(0x00000011)
20:04:19.185 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 5772 3 tsv.cpp 126 p(0x0133FC5C) = 25(0x00000019)
20:04:19.185 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 126 p(0x0153FC5C) = 19(0x00000013)
20:04:19.185 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 5772 3 tsv.cpp 126 p(0x0133FC5C) = 27(0x0000001B)
20:04:19.185 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 126 p(0x0153FC5C) = 21(0x00000015)
20:04:19.185 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 5772 3 tsv.cpp 126 p(0x0133FC5C) = 29(0x0000001D)
20:04:19.185 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 126 p(0x0153FC5C) = 23(0x00000017)
20:04:19.185 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 5772 3 tsv.cpp 126 p(0x0133FC5C) = 31(0x0000001F)
20:04:19.185 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 126 p(0x0153FC5C) = 25(0x00000019)
20:04:19.185 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 5772 3 tsv.cpp 126 p(0x0133FC5C) = 33(0x00000021)
20:04:19.185 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 126 p(0x0153FC5C) = 27(0x0000001B)
20:04:19.185 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 5772 3 tsv.cpp 126 p(0x0133FC5C) = 35(0x00000023)
20:04:19.185 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 126 p(0x0153FC5C) = 29(0x0000001D)
20:04:19.185 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.185 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.185 5772 3 tsv.cpp 126 p(0x0133FC5C) = 37(0x00000025)
20:04:19.185 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.185 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.185 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.185 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.184 868 3 tsv.cpp 126 p(0x0143FC5C) = 5(0x00000005)
20:04:19.185 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.186 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 4264 3 tsv.cpp 126 p(0x0153FC5C) = 31(0x0000001F)
20:04:19.186 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.186 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.186 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.186 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.186 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 5772 3 tsv.cpp 126 p(0x0133FC5C) = 39(0x00000027)
20:04:19.186 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.186 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.186 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.186 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.186 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 4264 3 tsv.cpp 126 p(0x0153FC5C) = 33(0x00000021)
20:04:19.186 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.186 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.186 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.186 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.186 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 5772 3 tsv.cpp 126 p(0x0133FC5C) = 41(0x00000029)
20:04:19.186 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.186 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.186 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.186 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.186 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 4264 3 tsv.cpp 126 p(0x0153FC5C) = 35(0x00000023)
20:04:19.186 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.186 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.186 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.186 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.186 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.186 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.186 5772 3 tsv.cpp 126 p(0x0133FC5C) = 43(0x0000002B)
20:04:19.186 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.186 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.186 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.186 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.186 5772 3 tsv.cpp 126 p(0x0133FC5C) = 45(0x0000002D)
20:04:19.186 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.186 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.186 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.186 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.186 5772 3 tsv.cpp 126 p(0x0133FC5C) = 47(0x0000002F)
20:04:19.186 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.186 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.186 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.186 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.186 5772 3 tsv.cpp 126 p(0x0133FC5C) = 49(0x00000031)
20:04:19.186 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.186 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.186 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.186 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.186 5772 3 tsv.cpp 126 p(0x0133FC5C) = 51(0x00000033)
20:04:19.186 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.186 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.186 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.186 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.186 5772 3 tsv.cpp 126 p(0x0133FC5C) = 53(0x00000035)
20:04:19.186 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.186 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.186 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.186 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.187 5772 3 tsv.cpp 126 p(0x0133FC5C) = 55(0x00000037)
20:04:19.187 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.187 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.187 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.187 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.187 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.187 5772 3 tsv.cpp 126 p(0x0133FC5C) = 57(0x00000039)
20:04:19.187 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.187 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.187 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.187 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.187 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.187 5772 3 tsv.cpp 126 p(0x0133FC5C) = 59(0x0000003B)
20:04:19.187 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.187 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.187 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.187 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.187 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.187 5772 3 tsv.cpp 126 p(0x0133FC5C) = 61(0x0000003D)
20:04:19.187 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.187 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.187 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.187 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.187 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.187 5772 3 tsv.cpp 126 p(0x0133FC5C) = 63(0x0000003F)
20:04:19.187 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.187 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.187 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.187 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.187 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.187 5772 3 tsv.cpp 126 p(0x0133FC5C) = 65(0x00000041)
20:04:19.187 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.187 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.187 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.187 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.187 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.187 5772 3 tsv.cpp 126 p(0x0133FC5C) = 67(0x00000043)
20:04:19.187 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.187 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.187 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.187 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.187 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.187 5772 3 tsv.cpp 126 p(0x0133FC5C) = 69(0x00000045)
20:04:19.187 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.187 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.187 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.187 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.187 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.187 5772 3 tsv.cpp 126 p(0x0133FC5C) = 71(0x00000047)
20:04:19.187 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.187 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.187 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.187 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.187 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.187 5772 3 tsv.cpp 126 p(0x0133FC5C) = 73(0x00000049)
20:04:19.187 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.187 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.187 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.187 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.188 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.188 5772 3 tsv.cpp 126 p(0x0133FC5C) = 75(0x0000004B)
20:04:19.188 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.188 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.188 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.188 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.188 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.188 5772 3 tsv.cpp 126 p(0x0133FC5C) = 77(0x0000004D)
20:04:19.188 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.188 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.188 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.188 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.188 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.188 5772 3 tsv.cpp 126 p(0x0133FC5C) = 79(0x0000004F)
20:04:19.188 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.188 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.188 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.188 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.188 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.188 5772 3 tsv.cpp 126 p(0x0133FC5C) = 81(0x00000051)
20:04:19.188 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.188 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.188 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.188 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.188 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.188 5772 3 tsv.cpp 126 p(0x0133FC5C) = 83(0x00000053)
20:04:19.188 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.188 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.188 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.188 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.188 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.188 5772 3 tsv.cpp 126 p(0x0133FC5C) = 85(0x00000055)
20:04:19.188 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.188 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.188 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.188 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.188 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.188 5772 3 tsv.cpp 126 p(0x0133FC5C) = 87(0x00000057)
20:04:19.188 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.188 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.188 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.188 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.188 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.188 5772 3 tsv.cpp 126 p(0x0133FC5C) = 89(0x00000059)
20:04:19.188 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.188 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.188 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.188 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.188 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.188 5772 3 tsv.cpp 126 p(0x0133FC5C) = 91(0x0000005B)
20:04:19.188 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.188 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.188 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.188 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.188 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.188 5772 3 tsv.cpp 126 p(0x0133FC5C) = 93(0x0000005D)
20:04:19.188 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.188 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.188 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.188 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.189 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.189 5772 3 tsv.cpp 126 p(0x0133FC5C) = 95(0x0000005F)
20:04:19.189 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.189 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.189 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.186 4264 3 tsv.cpp 126 p(0x0153FC5C) = 37(0x00000025)
20:04:19.189 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.189 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.189 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.189 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.189 5772 3 tsv.cpp 126 p(0x0133FC5C) = 97(0x00000061)
20:04:19.189 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.189 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.189 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.189 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.189 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.189 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.189 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.189 4264 3 tsv.cpp 126 p(0x0153FC5C) = 39(0x00000027)
20:04:19.189 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.189 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.189 5772 3 tsv.cpp 126 p(0x0133FC5C) = 99(0x00000063)
20:04:19.189 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.189 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.189 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.189 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.189 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.189 5772 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.189 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.189 5772 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.189 4264 3 tsv.cpp 126 p(0x0153FC5C) = 41(0x00000029)
20:04:19.189 5772 4 tsv.cpp 113 △if (pn) == false;
20:04:19.189 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.189 5772 3 tsv.cpp 126 p(0x0133FC5C) = 101(0x00000065)
20:04:19.189 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.189 5772 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.189 4264 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.189 5772 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.189 4264 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.189 5772 2 tsv.cpp 111 ▽if (current %p) == false;
20:04:19.189 4264 4 tsv.cpp 113 △if (pn) == false;
20:04:19.189 5772 3 tsv.cpp 135 current(0x0133FD9C) = 1(0x00000001)
20:04:19.189 4264 3 tsv.cpp 126 p(0x0153FC5C) = 43(0x0000002B)
20:04:19.189 5772 3 tsv.cpp 140 pn(0x0133FC54) = 1(0x00000001)
20:04:19.189 4264 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.189 5772 3 tsv.cpp 111 △if (current %p) == false;
20:04:19.189 4264 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.189 5772 2 tsv.cpp 109 while (1 < current) == false;
20:04:19.189 4264 2 tsv.cpp 111 ▽if (current %p) == false;
20:04:19.189 5772 2 tsv.cpp 144 ▽if (1 < pn) == false;
20:04:19.189 4264 3 tsv.cpp 135 current(0x0153FD9C) = 1(0x00000001)
20:04:19.189 5772 3 tsv.cpp 144 △if (1 < pn) == false;
20:04:19.189 4264 3 tsv.cpp 140 pn(0x0153FC54) = 1(0x00000001)
20:04:19.189 5772 2 tsv.cpp 104 △if (1 < current) == true;
20:04:19.189 4264 3 tsv.cpp 111 △if (current %p) == false;
20:04:19.189 4264 2 tsv.cpp 109 while (1 < current) == false;
20:04:19.189 4264 2 tsv.cpp 144 ▽if (1 < pn) == false;
20:04:19.189 4264 3 tsv.cpp 144 △if (1 < pn) == false;
20:04:19.189 4264 2 tsv.cpp 104 △if (1 < current) == true;
20:04:19.189 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.189 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.189 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.189 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.189 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.189 868 3 tsv.cpp 126 p(0x0143FC5C) = 7(0x00000007)
20:04:19.189 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.189 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.189 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.189 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.189 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.189 868 3 tsv.cpp 126 p(0x0143FC5C) = 9(0x00000009)
20:04:19.189 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.189 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.189 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.189 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.190 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.190 868 3 tsv.cpp 126 p(0x0143FC5C) = 11(0x0000000B)
20:04:19.190 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.190 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.190 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.190 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.190 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.190 868 3 tsv.cpp 126 p(0x0143FC5C) = 13(0x0000000D)
20:04:19.190 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.190 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.190 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.190 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.190 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.190 868 3 tsv.cpp 126 p(0x0143FC5C) = 15(0x0000000F)
20:04:19.190 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.190 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.190 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.190 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.190 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.190 868 3 tsv.cpp 126 p(0x0143FC5C) = 17(0x00000011)
20:04:19.190 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.190 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.190 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.190 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.190 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.190 868 3 tsv.cpp 126 p(0x0143FC5C) = 19(0x00000013)
20:04:19.190 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.190 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.190 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.190 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.190 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.190 868 3 tsv.cpp 126 p(0x0143FC5C) = 21(0x00000015)
20:04:19.190 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.190 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.190 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.190 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.190 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.190 868 3 tsv.cpp 126 p(0x0143FC5C) = 23(0x00000017)
20:04:19.190 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.190 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.190 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.190 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.190 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.190 5772 1 tsv.cpp 154 return
20:04:19.190 5772 1 tsv.cpp 161 return
20:04:19.190 5772 1 bug.h 2468 日付&時刻:2008-02-24(日) 20:04:19.190
20:04:19.190 5772 1 bug.h 2469 △bugbeard session root
20:04:19.190 868 3 tsv.cpp 126 p(0x0143FC5C) = 25(0x00000019)
20:04:19.191 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.191 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.191 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.191 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.191 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.191 868 3 tsv.cpp 126 p(0x0143FC5C) = 27(0x0000001B)
20:04:19.191 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.191 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.191 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.191 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.191 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.191 868 3 tsv.cpp 126 p(0x0143FC5C) = 29(0x0000001D)
20:04:19.191 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.191 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.191 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.191 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.191 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.191 868 3 tsv.cpp 126 p(0x0143FC5C) = 31(0x0000001F)
20:04:19.191 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.191 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.191 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.191 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.191 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.191 868 3 tsv.cpp 126 p(0x0143FC5C) = 33(0x00000021)
20:04:19.191 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.191 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.191 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.191 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.191 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.191 868 3 tsv.cpp 126 p(0x0143FC5C) = 35(0x00000023)
20:04:19.191 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.191 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.191 4264 1 tsv.cpp 154 return
20:04:19.191 4264 1 tsv.cpp 161 return
20:04:19.191 4264 1 bug.h 2468 日付&時刻:2008-02-24(日) 20:04:19.191
20:04:19.191 4264 1 bug.h 2469 △bugbeard session root
20:04:19.191 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.191 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.191 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.191 868 3 tsv.cpp 126 p(0x0143FC5C) = 37(0x00000025)
20:04:19.191 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.191 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.191 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.191 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.191 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.191 868 3 tsv.cpp 126 p(0x0143FC5C) = 39(0x00000027)
20:04:19.192 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.192 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.192 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.192 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.192 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.192 868 3 tsv.cpp 126 p(0x0143FC5C) = 41(0x00000029)
20:04:19.192 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.192 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.192 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.192 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.192 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.192 868 3 tsv.cpp 126 p(0x0143FC5C) = 43(0x0000002B)
20:04:19.192 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.192 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.192 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.192 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.192 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.192 868 3 tsv.cpp 126 p(0x0143FC5C) = 45(0x0000002D)
20:04:19.192 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.192 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.192 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.192 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.192 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.192 868 3 tsv.cpp 126 p(0x0143FC5C) = 47(0x0000002F)
20:04:19.192 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.192 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.192 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.192 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.192 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.192 868 3 tsv.cpp 126 p(0x0143FC5C) = 49(0x00000031)
20:04:19.192 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.192 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.192 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.192 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.192 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.192 868 3 tsv.cpp 126 p(0x0143FC5C) = 51(0x00000033)
20:04:19.192 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.192 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.192 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.192 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.192 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.192 868 3 tsv.cpp 126 p(0x0143FC5C) = 53(0x00000035)
20:04:19.192 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.192 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.192 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.192 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.192 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.192 868 3 tsv.cpp 126 p(0x0143FC5C) = 55(0x00000037)
20:04:19.192 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.192 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.192 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.192 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.192 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.192 868 3 tsv.cpp 126 p(0x0143FC5C) = 57(0x00000039)
20:04:19.192 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.192 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.192 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.192 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.192 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.192 868 3 tsv.cpp 126 p(0x0143FC5C) = 59(0x0000003B)
20:04:19.193 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.193 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.193 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.193 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.193 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.193 868 3 tsv.cpp 126 p(0x0143FC5C) = 61(0x0000003D)
20:04:19.193 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.193 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.193 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.193 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.193 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.193 868 3 tsv.cpp 126 p(0x0143FC5C) = 63(0x0000003F)
20:04:19.193 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.193 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.193 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.193 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.193 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.193 868 3 tsv.cpp 126 p(0x0143FC5C) = 65(0x00000041)
20:04:19.193 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.193 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.193 868 2 tsv.cpp 111 ▽if (current %p) == true;
20:04:19.193 868 3 tsv.cpp 113 ▽if (pn) == false;
20:04:19.193 868 4 tsv.cpp 113 △if (pn) == false;
20:04:19.193 868 3 tsv.cpp 126 p(0x0143FC5C) = 67(0x00000043)
20:04:19.193 868 3 tsv.cpp 111 △if (current %p) == true;
20:04:19.193 868 2 tsv.cpp 109 while (1 < current) == true;
20:04:19.193 868 2 tsv.cpp 111 ▽if (current %p) == false;
20:04:19.193 868 3 tsv.cpp 135 current(0x0143FD9C) = 1(0x00000001)
20:04:19.193 868 3 tsv.cpp 140 pn(0x0143FC54) = 1(0x00000001)
20:04:19.193 868 3 tsv.cpp 111 △if (current %p) == false;
20:04:19.193 868 2 tsv.cpp 109 while (1 < current) == false;
20:04:19.193 868 2 tsv.cpp 144 ▽if (1 < pn) == false;
20:04:19.193 868 3 tsv.cpp 144 △if (1 < pn) == false;
20:04:19.193 868 2 tsv.cpp 104 △if (1 < current) == true;
20:04:19.194 868 1 tsv.cpp 154 return
20:04:19.194 868 1 tsv.cpp 161 return
20:04:19.194 868 1 bug.h 2468 日付&時刻:2008-02-24(日) 20:04:19.194
20:04:19.194 868 1 bug.h 2469 △bugbeard session root
20:04:19.194 540 2 tsv.cpp 184 △for
20:04:19.194 540 1 tsv.cpp 189 ▽delete
20:04:19.194 540 2 tsv.cpp 189 △delete
20:04:19.194 540 1 tsv.cpp 191 return
20:04:19.194 540 1 bug.h 2468 日付&時刻:2008-02-24(日) 20:04:19.194
20:04:19.194 540 1 bug.h 2469 △bugbeard session root
```

#### 解説

上記の出力結果は...

```txt
20:04:19.183 540 1 bug.h 2849 ▽Commandline Argument Information
20:04:19.183 540 2 bug.h 2850 argc(0x0012FAC8) = 4(0x00000004)
20:04:19.183 540 2 bug.h 2853 args[0]:tsv
20:04:19.183 540 2 bug.h 2853 args[1]:101
20:04:19.183 540 2 bug.h 2853 args[2]:201
20:04:19.183 540 2 bug.h 2853 args[3]:301
20:04:19.183 540 2 bug.h 2849 △Commandline Argument Information
```

...を見てもおわかりいただけますが、「101 201 301」を引数として与えた場合のものです。
またこのケースでは .tsv の各カラムはそれぞれ 時刻, スレッドID, ネストの深さ, `__FILE__`, `__LINE__`, ログメッセージ の内容になっていますが、コンパイル時の状況によりこの書式は若干変化します。

このサンプルでの一つ目の肝は...

```c++
// 標準エラーにTSV形式の出力を行うロガーの定義(メインスレッド用)
BUG_define_logger(new bugbeard::bug_tsv_logger(common_writer));
```

...で、ツリー形式ではなく .tsv 形式のログ出力を指定しているところです。ロガーへの引数がこれまでのサンプルと違いますが、これはマルチスレッド対応の為のもので、.tsv 形式でログ出力を行うこととは本質的には関係ありません。

このサンプルでの二つの肝は最初に `bug.h` を `#include` する前に...

```c++
#define BUG_EVIL_CONTRACT // "悪魔の契約"
#define BUG_MULTI_THREAD // マルチスレッドモデルでバグベアードを利用
#include "bug.h" // ロガーを定義する為にステートメントハックを有効にしない状態で include
```

`BUG_MULTI_THREAD` マクロを定義してバグベアードをマルチスレッドモデルで利用すること宣言した上で、ロガーを...

```c++
// 共用ライターの定義
BUG_exec(bugbeard::bug_smart_writer common_writer(new bugbeard::bug_file_writer_base(stderr)));

// 標準エラーにTSV形式の出力を行うロガーの定義(メインスレッド用)
BUG_define_logger(new bugbeard::bug_tsv_logger(common_writer));
```

```c++
BUG_THREAD_RESULT BUG_THREAD_CALL factorize_thread(void * data)
{
// [BUG]スレッドローカルロガーの定義
BUG_define_logger(new bugbeard::bug_tsv_logger(common_writer));
factorize((int)data);
return 0;
}
```

...の�