Files
discord-decomp/_bundle/logToConsole.js
T
2026-11-01 12:12:55 +02:00

182 lines
6.2 KiB
JavaScript

// Metro module 1612 (f1613).
import { addLogBoxLog } from "./Module1611";
let logToConsole, c1278_6, formatMessage, createLog, registerLoggerConfig, handleLog;
let c1278_3 = "If you don't want to see this message, you can disable the `strict` mode. Refer to:\nhttps://docs.swmansion.com/react-native-reanimated/docs/debugging/logger-configuration for more details.";
let c1278_4 = {
warn: 1,
1: "warn",
error: 2,
2: "error"
};
const logToConsole2 = function logToConsole(a0) {
L6: {
const level = a0.level;
if (level === "warn") {
console.warn(a0.message.content);
} else {
if (level !== "error" && level !== "fatal" && level !== "syntax") {
break L6;
}
console.error(a0.message.content);
}
}
};
logToConsole2.__closure = {};
logToConsole2.__workletHash = 4297880609329;
logToConsole2.__initData = {
code: "function logToConsole_Pnpm_loggerTs1(data){switch(data.level){case'warn':console.warn(data.message.content);break;case'error':case'fatal':case'syntax':console.error(data.message.content);break;}}"
};
logToConsole = logToConsole2;
c1278_6 = {
logFunction: logToConsole,
level: c1278_4.warn,
strict: true
};
const formatMessage2 = function formatMessage(a0) {
return `[Reanimated] ${a0}`;
};
formatMessage2.__closure = {};
formatMessage2.__workletHash = 4586683970876;
formatMessage2.__initData = {
code: "function formatMessage_Pnpm_loggerTs2(message){return\"[Reanimated] \"+message;}"
};
formatMessage = formatMessage2;
const createLog2 = function createLog(a0, a1) {
const category = `[Reanimated] ${a1}`;
return {
level: a0,
message: {
content: category,
substitutions: []
},
category,
componentStack: [],
componentStackType: null,
stack: new Error().stack
};
};
createLog2.__closure = {
formatMessage
};
createLog2.__workletHash = 5107313473751;
createLog2.__initData = {
code: "function createLog_Pnpm_loggerTs3(level,message){const{formatMessage}=this.__closure;const formattedMessage=formatMessage(message);return{level:level,message:{content:formattedMessage,substitutions:[]},category:formattedMessage,componentStack:[],componentStackType:null,stack:new Error().stack};}"
};
createLog = createLog2;
const registerLoggerConfig2 = function registerLoggerConfig(a0) {
global.__reanimatedLoggerConfig = a0;
};
registerLoggerConfig2.__closure = {};
registerLoggerConfig2.__workletHash = 1484852907300;
registerLoggerConfig2.__initData = {
code: "function registerLoggerConfig_Pnpm_loggerTs4(config){global.__reanimatedLoggerConfig=config;}"
};
registerLoggerConfig = registerLoggerConfig2;
export function replaceLoggerImplementation(a0) {
global.__reanimatedLoggerConfig = {
...global.__reanimatedLoggerConfig,
logFunction: a0
};
}
replaceLoggerImplementation.__closure = {
registerLoggerConfig
};
replaceLoggerImplementation.__workletHash = 9450518662656;
replaceLoggerImplementation.__initData = {
code: "function replaceLoggerImplementation_Pnpm_loggerTs5(logFunction){const{registerLoggerConfig}=this.__closure;registerLoggerConfig({...global.__reanimatedLoggerConfig,logFunction:logFunction});}"
};
export function updateLoggerConfig(a0) {
let level = a0?.level;
if (level == null) {
level = c1278_6.level;
}
let strict = a0?.strict;
if (strict == null) {
strict = c1278_6.strict;
}
global.__reanimatedLoggerConfig = {
...global.__reanimatedLoggerConfig,
level,
strict
};
}
updateLoggerConfig.__closure = {
registerLoggerConfig,
DEFAULT_LOGGER_CONFIG: c1278_6
};
updateLoggerConfig.__workletHash = 14435084623184;
updateLoggerConfig.__initData = {
code: "function updateLoggerConfig_Pnpm_loggerTs6(options){const{registerLoggerConfig,DEFAULT_LOGGER_CONFIG}=this.__closure;var _options$level,_options$strict;registerLoggerConfig({...global.__reanimatedLoggerConfig,level:(_options$level=options===null||options===void 0?void 0:options.level)!==null&&_options$level!==void 0?_options$level:DEFAULT_LOGGER_CONFIG.level,strict:(_options$strict=options===null||options===void 0?void 0:options.strict)!==null&&_options$strict!==void 0?_options$strict:DEFAULT_LOGGER_CONFIG.strict});}"
};
const handleLog2 = function handleLog(a0, a1, a2) {
const __reanimatedLoggerConfig2 = global.__reanimatedLoggerConfig;
if (!(a2.strict && !__reanimatedLoggerConfig2.strict || c1278_4[a0] < __reanimatedLoggerConfig2.level)) {
const category = `[Reanimated] ${a2.strict ? a1 + `
${c1278_3}` : a1}`;
__reanimatedLoggerConfig2.logFunction({
level: a0,
message: {
content: category,
substitutions: []
},
category,
componentStack: [],
componentStackType: null,
stack: new Error().stack
});
}
};
handleLog2.__closure = {
LogLevel: c1278_4,
DOCS_REFERENCE: c1278_3,
createLog
};
handleLog2.__workletHash = 5113579927044;
handleLog2.__initData = {
code: "function handleLog_Pnpm_loggerTs7(level,message,options){const{LogLevel,DOCS_REFERENCE,createLog}=this.__closure;const config=global.__reanimatedLoggerConfig;if(options.strict&&!config.strict||LogLevel[level]<config.level){return;}if(options.strict){message+=\"\\n\\n\"+DOCS_REFERENCE;}config.logFunction(createLog(level,message));}"
};
handleLog = handleLog2;
const v = function v(a0, r5 = {}) {
handleLog("warn", a0, r5);
};
v.__closure = {
handleLog
};
v.__workletHash = 13521870617115;
v.__initData = {
code: "function warn_Pnpm_loggerTs8(message,options={}){const{handleLog}=this.__closure;handleLog('warn',message,options);}"
};
const L = function L(a0, r5 = {}) {
handleLog("error", a0, r5);
};
L.__closure = {
handleLog
};
L.__workletHash = 10275432056698;
L.__initData = {
code: "function error_Pnpm_loggerTs9(message,options={}){const{handleLog}=this.__closure;handleLog('error',message,options);}"
};
const r52 = {
warn: v,
error: L
};
export { c1278_4 as LogLevel };
export { c1278_6 as DEFAULT_LOGGER_CONFIG };
export function logToLogBoxAndConsole(a0) {
addLogBoxLog(a0);
L8: {
const level = a0.level;
if (level === "warn") {
console.warn(a0.message.content);
} else {
if (level !== "error" && level !== "fatal" && level !== "syntax") {
break L8;
}
console.error(a0.message.content);
}
}
}
export { registerLoggerConfig };
export { r52 as logger };