TransitApp/SVHTTPRequest

Add a way to customize/override logging

svintus opened this issue · 2 comments

I think it would be beneficial to have SVHPPTRequest support custom logging. Personally I'd like to hook it into CocoaLumberjack but I'm sure there are other custom loggers that are reasonably popular. Only having an option to disable logging with a compile-time switch is cumbersome (especially if SVHTTPRequest is installed via CocoaPods).

I am not sure what the best approach is - providing an optional logger block callback? SVHTTPRequestLogger delegate?

I'm not familiar with CocoaLumberjack or custom logging. What exactly would you like to be logged?

The compiler flag is the best way I could think of to disable logging... I'm not sure this is something you should be disabling using actual code. Why is it cumbersome to set a compiler flag when you're installing via CocoaPods? (I don't use CocoaPods)

It could be just me, but I've had issues in the past where adding a setting to a CocoaPods project was overwritten by pod install.

CocoaLumberjack allows one to have an elaborate logging setup with multiple loggers that log to different places (e.g. everything is logged to the console, errors/warnings are colourized and also logged via TestFlight logger as well, etc.).

The reason why I want to have custom logging for SVHTTPRequest in particular is because it can potentially leak personal information (emails) passed as GET parameters. I don't want to disable request logging completely because it's very helpful for troubleshooting backend issues, but I'd like to have a custom logger that scrubs anything that looks like an email from the log.