seri2ethをデバッグモードで起動する

seri2ethのログを書き込んでる場所がどうにも分からなかったので、デバッグモードで起動するように修正してみました。

参考にしたページ

ソースコードの修正

seri2ethのソースコードを以下のように修正してmakeします。

/* //////////////////// macro define ///////////////////// */
#define __DEBUG__    <---この行を追加
#ifdef __DEBUG__
#define LOG(args...)	printf(args)
#define ERR(args...)	printf(args)
#define PERROR(args...)	perror(args)
#define RESET_SIGNAL	SIGINT
#else
#define LOG(args...)	{}
#define ERR(args...)	{}
#define PERROR(args...)	{}
#define RESET_SIGNAL	SIGUSR1
#endif

ポイント

  • "#define __DEBUG__"を追加してmakeするのみ
  • 元に戻すには"//"を行頭に追加してmakeです