expo-finance-kit
Version:
Native Expo module for Apple FinanceKit - Access financial data from Apple Card and other accounts
37 lines (36 loc) • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Logging = void 0;
// very simple logger to avoid poluting end users with debug messages
class Logger {
showDebug = false;
consoleAvailable = false;
constructor() {
if (typeof process?.env !== 'undefined') {
this.showDebug = process.env.NODE_ENV?.toLowerCase() === 'development' || false;
}
this.consoleAvailable = typeof console !== 'undefined';
}
debug(message, ...optionalParams) {
if (!this.showDebug || !this.consoleAvailable) {
return;
}
console.debug(message, ...optionalParams);
}
warn(message, ...optionalParams) {
if (!this.consoleAvailable) {
return;
}
console.warn(message, optionalParams);
}
}
class Logging {
static instance;
static get logger() {
if (!this.instance) {
this.instance = new Logger();
}
return this.instance;
}
}
exports.Logging = Logging;