Please sign in to comment.
Implemented better Xcode integration for warnings and errors. Closes #…
…105. By using special log format `--logformat xcode`, appledoc formats warnings and errors related to source files in a way that Xcode is able to catch them and display them in build results. Currently only warnings are using that format (there is no error log message related to source files). *Implementation details:* Note that implementation required tweaking Cocoa Lumberjack source. Specifically, it required passing in original source code filename and line number to log message. Although logging macros pick up source file and line automatically through `__FILE__` and `__LINE__`, these belong to appledoc sources. But for Xcode warnings making sense, we need to write the file name and line of the context being parsed. To reuse existing macros, I added both values to DDMessage and additional class method to DDLog which needs to be called prior to logging. The method will simply store info to static vars. Then logging method will pick up stored values, write them to message and reset static vars. When emitting log messages, Xcode formatter will check if these values are set and emit specially formatted logs, otherwise it will revert to message only. *Additional note:* Although I searched for all occurrences of `GBLogWarn` and `GBLogError` in the project and updated those that seemed relevant, some may have been left out - let me know about exact messages and I will check it. Also note that parsing code currently doesn't emit warnings, if something goes wrong, exceptions are raised, which doesn't log the file and line. Didn't take much time to go into this as these usually indicate parsing code needs to be refined.
- Loading branch information...
Showing with 63 additions and 11 deletions.