Logging
The Zeta React Native SDK routes diagnostic output to the native platform loggers — Apple's Unified Logging System on iOS and Logcat on Android. Control log verbosity and privacy from JavaScript before initialization.
All logging APIs are static methods on the ZTLogger class. No SDK initialization is required before calling them.
On this page
Enable logging
By default, the SDK produces no log output (NONE). Enable logging as early as possible — typically before calling ZetaClient.initialize(...):
import { ZTLogger, ZTLogLevel } from 'zetakit_reactnative';
ZTLogger.setLogLevel(ZTLogLevel.DEBUG);Log levels
ZTLogger.setLogLevel() accepts a ZTLogLevel enum value. Only messages at or above the configured level are emitted.
| Level | Description |
|---|---|
NONE | No SDK messages (default) |
VERBOSE | All messages including fine-grained diagnostics |
DEBUG | Development diagnostics |
INFO | Notable operational events |
WARNING | Potential issues |
ERROR | Failures and error conditions |
import { ZTLogger, ZTLogLevel } from 'zetakit_reactnative';
// Development — see all SDK logs
ZTLogger.setLogLevel(ZTLogLevel.VERBOSE);
// Production — silence SDK logs
ZTLogger.setLogLevel(ZTLogLevel.NONE);Log privacy (iOS only)
ZTLogger.setLogPrivacy() controls whether SDK log message content is visible in Console.app and system diagnostic captures (sysdiagnose). On Android this is a no-op.
| Privacy | Description |
|---|---|
PRIVATE | Message content redacted in system log captures. Default. |
PUBLIC | Message content fully visible in all system log captures. Use only in non-production builds. |
import { ZTLogger, ZTLogPrivacy } from 'zetakit_reactnative';
ZTLogger.setLogPrivacy(ZTLogPrivacy.PUBLIC);Important: Ensure no PII is present in SDK logs when using
PUBLICprivacy.
Recommended setup
import ZetaClient, {
ZTRegion,
ZTAppEnvironment,
ZTLogger,
ZTLogLevel,
ZTLogPrivacy,
} from 'zetakit_reactnative';
// Set log level based on build type
if (__DEV__) {
ZTLogger.setLogLevel(ZTLogLevel.DEBUG);
ZTLogger.setLogPrivacy(ZTLogPrivacy.PUBLIC);
} else {
ZTLogger.setLogLevel(ZTLogLevel.NONE);
}
const config = {
clientSiteId: 'your-site-id',
clientSecret: 'your-secret',
region: ZTRegion.US,
optIn: true,
appEnvironment: ZTAppEnvironment.PRODUCTION,
};
ZetaClient.initialize(config, () => {
// SDK is ready
});See also
- Getting Started — SDK initialization.
- Migration Guide — migrating from
isLoggingEnabled. - iOS Logging — native iOS logging details.
- Android Logging — native Android logging details.

