42 lines
1.6 KiB
JavaScript
42 lines
1.6 KiB
JavaScript
// Metro module 13482 (f13483).
|
|
let hasLoggerPlugin;
|
|
export default () => (c27466_0) => ({
|
|
features: {
|
|
log: function log(...args) {
|
|
c27466_0.send("log", {
|
|
level: "debug",
|
|
message: args ? args.length === 1 ? args[0] : args : args
|
|
}, false);
|
|
},
|
|
logImportant: function logImportant(...args) {
|
|
c27466_0.send("log", {
|
|
level: "debug",
|
|
message: args ? args.length === 1 ? args[0] : args : args
|
|
}, true);
|
|
},
|
|
debug: function debug(a0, r1 = false) {
|
|
return c27466_0.send("log", {
|
|
level: "debug",
|
|
message: a0
|
|
}, !!r1);
|
|
},
|
|
warn: (a0) => c27466_0.send("log", {
|
|
level: "warn",
|
|
message: a0
|
|
}, true),
|
|
error: (a0, a1) => c27466_0.send("log", {
|
|
level: "error",
|
|
message: a0,
|
|
stack: a1
|
|
}, true)
|
|
}
|
|
});
|
|
hasLoggerPlugin = (a0) => (a0 ? "log" in a0 : a0) && typeof a0.log === "function" && "logImportant" in a0 && typeof a0.logImportant === "function" && "debug" in a0 && typeof a0.debug === "function" && "warn" in a0 && typeof a0.warn === "function" && "error" in a0 && typeof a0.error === "function";
|
|
export { hasLoggerPlugin };
|
|
export const assertHasLoggerPlugin = (a0) => {
|
|
if ((a0 ? "log" in a0 : a0) && typeof a0.log === "function" && "logImportant" in a0 && typeof a0.logImportant === "function" && "debug" in a0 && typeof a0.debug === "function" && "warn" in a0 && typeof a0.warn === "function" && "error" in a0 && typeof a0.error === "function") {
|
|
return void 0;
|
|
}
|
|
throw new Error("This Reactotron client has not had the logger plugin applied to it. Make sure that you add `use(logger())` before adding this plugin.");
|
|
};
|