Reputation: 4590
Reading the NSLog()
statements in the console is difficult because it takes me a while to parse out the different statements. Is there a way to automatically have some line break between each NSLog()
call's resulting log?
Upvotes: 1
Views: 1085
Reputation: 53010
How are you reading the console log?
Every NSLog
does produce a seperate line in the console log - as viewed in Xcode, the Console app, or by listing the log file directly in the Terminal.
If you wish to add extra line breaks into an NSLog
message you can use the standard C escape \n
in the format string, e.g.:
NSLog(@"First line\nsecond line");
HTH
Addendum
From your comment the following might help:
#define MyLog(fmt, args...) NSLog(fmt "\n\n", args)
This macro will expand to a call to NSLog with an added line break - note you need two \n
's, that isn't a typo. This will only work if the format is a literal string (two adjacent literal strings are concatenated by the compiler).
Define that in a project-wide header and then find/replace NSLog
with MyLog
and I think you might have what you wish.
Upvotes: 2