13
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

NSLogのカスタム方法(クラス・メソッド名・行数を表示)

Last updated at Posted at 2013-05-23

下記のようにdefine定義しておくと便利(クラス名・メソッド名・行数が表示される)

#ifdef DEBUG
#define TestLog(fmt,...) NSLog((@"%s:%d "fmt), PRETTY_FUNCTION, LINE, ##VA_ARGS);
#else
#define TestLog(...)
#endif

そんでもってソースコードのNSLogを下記のように変更すればOK
NSLog(@"%@",@"テスト");

TestLog(@"%@",@"テスト");

13
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?