Closed pai911 closed 8 years ago
Thanks for the kind words, but I did only on the connector, not the logger itself. Avoid the @ syntax, log.info("fullURL: (url)") should always work
Hi the problem is if I need to log an URL, this issue will happen..
If I am using only NSLogger, then i'll know % is a special character, then I can understand the crash.
But for other developers on my team, they may be shocked by this issue...
I am thinking about a way to solve this issue. For the NSLogger, the formatted string is used, and % is treated as a special char, and the way to escape it is to use "%%".
But this way, XCGLogger (default log destination: Console) will print out double % as well
What do you think about adding some escaping logic in the connector to escape % only for NSLogger?
I think it's okay to add this logic in: public override func output(logDetails: XCGLogDetails, text: String)
The following code can fix my problem:
var logMessage = logDetails.logMessage.stringByReplacingOccurrencesOfString("%", withString: "%%")
Have you considered raising this issue on XCGLogger directly?
It sounds like this is an issue that should be addressed there, not in this connector.
I encounter a very serious issue.
It seems there is a big difference between how XCGLogger & NSLogger handle Strings
In XCGLogger, it asks us to use String interpolation, but the NSLogger uses a way similar to NSLog (use %).
I'm not sure why, but after I integrated the connector, it seems that if I try to print some string with % in it, the app will just exit with error.
For example, "fullURL: %a" cannot be used or the app will crash because of bad memory access.
I really love your work, but I'm really concerned about this kind of error
Let me know if you need more info :)