You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The native code uses logging (NSLog) quite extensively. I am not familiar with Objective-C, but the documentation for this function says:
Logs an error message to the Apple System Log facility.
However, it is currently used for debug logging as well. And it is used in cases where a Java exception is thrown anyways so logging seems redundant (instead the exception message should be improved, if necessary).
Therefore I would recommend completely removing logging.
Note: It appears the build process was slightly incorrect, using an outdated libjcocoa.dylib, see 8266cd9. Therefore you might not have seen logging output yet.
Removing logging doesn't seem like a good idea. Why would you want that? It helps you to follow the flow in the native code (can't really debug it or at least nobody knows how to)
Ideally the project would be stable enough at some point to not require any logging at all, or where appropriate detailed exceptions are thrown. Log ouput might also reveal sensitive information, it would be better to let the user choose how they want to handle exceptions and what (if any) they want to log.
Additionally depending on your setup you might not even be able to read the log if you run this library without capturing the standard output/error stream.
I agree. That's too verbose. But I also agree that it can be nice to have verbose logging like this during debugging. Perhaps a setDebugMode(boolean) to enable/disable this logging would be best.
Activity
mojo2012 commentedon Jan 11, 2021
Removing logging doesn't seem like a good idea. Why would you want that? It helps you to follow the flow in the native code (can't really debug it or at least nobody knows how to)
Marcono1234 commentedon Jan 11, 2021
Ideally the project would be stable enough at some point to not require any logging at all, or where appropriate detailed exceptions are thrown. Log ouput might also reveal sensitive information, it would be better to let the user choose how they want to handle exceptions and what (if any) they want to log.
Additionally depending on your setup you might not even be able to read the log if you run this library without capturing the standard output/error stream.
Currently with these log statements the build log looks like this:

(see https://github.com/shannah/Java-Objective-C-Bridge/runs/1678219378)
I assume it does not look much better if you would run it in production.
shannah commentedon Jan 11, 2021
I agree. That's too verbose. But I also agree that it can be nice to have verbose logging like this during debugging. Perhaps a
setDebugMode(boolean)to enable/disable this logging would be best.Add RuntimeUtils#setDebugMode to configure debug logging
Add RuntimeUtils#setDebugMode to configure debug logging