theos / logos

Preprocessor that simplifies Objective-C hooking.
https://theos.dev/docs/logos
Other
206 stars 34 forks source link

Decoupling from Theos #4

Closed uroboro closed 4 years ago

uroboro commented 6 years ago

There's a usage of HBLogDebug in bin/lib/Logos/Generator/Base/Method.pm which is defined in theos/headers/HBLog.h.

If Logos is truly meant to be decoupled, this logging facility has to be resolved in another manner, either as a builtin definition or a function name passed as a flag when running logos.pl. It should be taken into account that HBLogDebug is a macro that will end up expanding to os_log_with_type or CFLog.

kirb commented 6 years ago

Should be fine to switch back to just plain NSLog. It's the simplest choice, CFLog is private anyway so would require a dependency on the CFLogUtilities.h header. Color output from the HBLog macros was kinda necessary before os_log, now you can just filter to library == your binary name, so it's not really necessary. Could also use

#ifdef HBLogDebug
#define LogosLog HBLogDebug
#else
#define LogosLog NSLog
#endif
…
LogosLog(@"[%s:%i] blahblah", __FILE__, __LINE__, otherargs…);