/****************************************************************************** バグベアード -bugbeard- サンプル "simple.cpp" ソースファイル Coded by Wraith in Feb 18, 2008. ******************************************************************************/ /////////////////////////////////////////////////////////////////////////////// // // 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.〜 ■□■□ ******************************************************************************/