Dynamically Enable/Disable WebObjects SQL Logging
Join the DZone community and get the full member experience.Join For Free
Sometimes you want to log generated SQL selectively, so popping -DEOAdaptorDebugEnabled=true on the command line of your app is verbose overkill. Here's how you can selectively enable and disable SQL logging:
NSLog.allowDebugLoggingForGroups(0x10000L); // Do something that roundtrips the DB, like editingContext.saveChanges(). NSLog.refuseDebugLoggingForGroups(0x10000L);
Opinions expressed by DZone contributors are their own.