New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zhi-log

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zhi-log - npm Package Compare versions

Comparing version 1.5.2 to 1.5.3

442

lib/index.js

@@ -1,22 +0,18 @@

var K = Object.defineProperty;
var Y = (r, e, t) => e in r ? K(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
var b = (r, e, t) => (Y(r, typeof e != "symbol" ? e + "" : e, t), t);
var A = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function W(r) {
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
}
var F = {}, j = {
var D = Object.defineProperty;
var W = (i, e, t) => e in i ? D(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
var _ = (i, e, t) => (W(i, typeof e != "symbol" ? e + "" : e, t), t);
var P = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, b = {}, B = {
get exports() {
return F;
return b;
},
set exports(r) {
F = r;
set exports(i) {
b = i;
}
};
(function(r) {
(function(i) {
(function(e, t) {
r.exports ? r.exports = t() : e.log = t();
})(A, function() {
i.exports ? i.exports = t() : e.log = t();
})(P, function() {
var e = function() {
}, t = "undefined", u = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), f = [
}, t = "undefined", l = typeof window !== t && typeof window.navigator !== t && /Trident\/|MSIE /.test(window.navigator.userAgent), p = [
"trace",

@@ -28,45 +24,45 @@ "debug",

];
function l(c, p) {
var d = c[p];
if (typeof d.bind == "function")
return d.bind(c);
function s(a, c) {
var g = a[c];
if (typeof g.bind == "function")
return g.bind(a);
try {
return Function.prototype.bind.call(d, c);
return Function.prototype.bind.call(g, a);
} catch {
return function() {
return Function.prototype.apply.apply(d, [c, arguments]);
return Function.prototype.apply.apply(g, [a, arguments]);
};
}
}
function s() {
function u() {
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
}
function a(c) {
return c === "debug" && (c = "log"), typeof console === t ? !1 : c === "trace" && u ? s : console[c] !== void 0 ? l(console, c) : console.log !== void 0 ? l(console, "log") : e;
function w(a) {
return a === "debug" && (a = "log"), typeof console === t ? !1 : a === "trace" && l ? u : console[a] !== void 0 ? s(console, a) : console.log !== void 0 ? s(console, "log") : e;
}
function g(c, p) {
for (var d = 0; d < f.length; d++) {
var i = f[d];
this[i] = d < c ? e : this.methodFactory(i, c, p);
function h(a, c) {
for (var g = 0; g < p.length; g++) {
var o = p[g];
this[o] = g < a ? e : this.methodFactory(o, a, c);
}
this.log = this.debug;
}
function m(c, p, d) {
function O(a, c, g) {
return function() {
typeof console !== t && (g.call(this, p, d), this[c].apply(this, arguments));
typeof console !== t && (h.call(this, c, g), this[a].apply(this, arguments));
};
}
function n(c, p, d) {
return a(c) || m.apply(this, arguments);
function r(a, c, g) {
return w(a) || O.apply(this, arguments);
}
function L(c, p, d) {
var i = this, S;
p = p ?? "WARN";
var v = "loglevel";
typeof c == "string" ? v += ":" + c : typeof c == "symbol" && (v = void 0);
function x(o) {
var E = (f[o] || "silent").toUpperCase();
if (!(typeof window === t || !v)) {
function v(a, c, g) {
var o = this, x;
c = c ?? "WARN";
var f = "loglevel";
typeof a == "string" ? f += ":" + a : typeof a == "symbol" && (f = void 0);
function C(n) {
var d = (p[n] || "silent").toUpperCase();
if (!(typeof window === t || !f)) {
try {
window.localStorage[v] = E;
window.localStorage[f] = d;
return;

@@ -76,3 +72,3 @@ } catch {

try {
window.document.cookie = encodeURIComponent(v) + "=" + E + ";";
window.document.cookie = encodeURIComponent(f) + "=" + d + ";";
} catch {

@@ -82,24 +78,24 @@ }

}
function T() {
var o;
if (!(typeof window === t || !v)) {
function S() {
var n;
if (!(typeof window === t || !f)) {
try {
o = window.localStorage[v];
n = window.localStorage[f];
} catch {
}
if (typeof o === t)
if (typeof n === t)
try {
var E = window.document.cookie, _ = E.indexOf(
encodeURIComponent(v) + "="
var d = window.document.cookie, m = d.indexOf(
encodeURIComponent(f) + "="
);
_ !== -1 && (o = /^([^;]+)/.exec(E.slice(_))[1]);
m !== -1 && (n = /^([^;]+)/.exec(d.slice(m))[1]);
} catch {
}
return i.levels[o] === void 0 && (o = void 0), o;
return o.levels[n] === void 0 && (n = void 0), n;
}
}
function N() {
if (!(typeof window === t || !v)) {
function V() {
if (!(typeof window === t || !f)) {
try {
window.localStorage.removeItem(v);
window.localStorage.removeItem(f);
return;

@@ -109,3 +105,3 @@ } catch {

try {
window.document.cookie = encodeURIComponent(v) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
window.document.cookie = encodeURIComponent(f) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
} catch {

@@ -115,3 +111,3 @@ }

}
i.name = c, i.levels = {
o.name = a, o.levels = {
TRACE: 0,

@@ -123,154 +119,113 @@ DEBUG: 1,

SILENT: 5
}, i.methodFactory = d || n, i.getLevel = function() {
return S;
}, i.setLevel = function(o, E) {
if (typeof o == "string" && i.levels[o.toUpperCase()] !== void 0 && (o = i.levels[o.toUpperCase()]), typeof o == "number" && o >= 0 && o <= i.levels.SILENT) {
if (S = o, E !== !1 && x(o), g.call(i, o, c), typeof console === t && o < i.levels.SILENT)
}, o.methodFactory = g || r, o.getLevel = function() {
return x;
}, o.setLevel = function(n, d) {
if (typeof n == "string" && o.levels[n.toUpperCase()] !== void 0 && (n = o.levels[n.toUpperCase()]), typeof n == "number" && n >= 0 && n <= o.levels.SILENT) {
if (x = n, d !== !1 && C(n), h.call(o, n, a), typeof console === t && n < o.levels.SILENT)
return "No console available for logging";
} else
throw "log.setLevel() called with invalid level: " + o;
}, i.setDefaultLevel = function(o) {
p = o, T() || i.setLevel(o, !1);
}, i.resetLevel = function() {
i.setLevel(p, !1), N();
}, i.enableAll = function(o) {
i.setLevel(i.levels.TRACE, o);
}, i.disableAll = function(o) {
i.setLevel(i.levels.SILENT, o);
throw "log.setLevel() called with invalid level: " + n;
}, o.setDefaultLevel = function(n) {
c = n, S() || o.setLevel(n, !1);
}, o.resetLevel = function() {
o.setLevel(c, !1), V();
}, o.enableAll = function(n) {
o.setLevel(o.levels.TRACE, n);
}, o.disableAll = function(n) {
o.setLevel(o.levels.SILENT, n);
};
var h = T();
h == null && (h = p), i.setLevel(h, !1);
var y = S();
y == null && (y = c), o.setLevel(y, !1);
}
var y = new L(), w = {};
y.getLogger = function(p) {
if (typeof p != "symbol" && typeof p != "string" || p === "")
var L = new v(), E = {};
L.getLogger = function(c) {
if (typeof c != "symbol" && typeof c != "string" || c === "")
throw new TypeError("You must supply a name when creating a logger.");
var d = w[p];
return d || (d = w[p] = new L(
p,
y.getLevel(),
y.methodFactory
)), d;
var g = E[c];
return g || (g = E[c] = new v(
c,
L.getLevel(),
L.methodFactory
)), g;
};
var V = typeof window !== t ? window.log : void 0;
return y.noConflict = function() {
return typeof window !== t && window.log === y && (window.log = V), y;
}, y.getLoggers = function() {
return w;
}, y.default = y, y;
var k = typeof window !== t ? window.log : void 0;
return L.noConflict = function() {
return typeof window !== t && window.log === L && (window.log = k), L;
}, L.getLoggers = function() {
return E;
}, L.default = L, L;
});
})(j);
var R = {}, X = {
})(B);
var T = {}, K = {
get exports() {
return R;
return T;
},
set exports(r) {
R = r;
set exports(i) {
T = i;
}
};
(function(r) {
(function(i) {
(function(e, t) {
r.exports ? r.exports = t() : e.prefix = t(e);
})(A, function(e) {
var t = function(n) {
for (var L = 1, y = arguments.length, w; L < y; L++)
for (w in arguments[L])
Object.prototype.hasOwnProperty.call(arguments[L], w) && (n[w] = arguments[L][w]);
return n;
}, u = {
i.exports ? i.exports = t() : e.prefix = t(e);
})(P, function(e) {
var t = function(r) {
for (var v = 1, L = arguments.length, E; v < L; v++)
for (E in arguments[v])
Object.prototype.hasOwnProperty.call(arguments[v], E) && (r[E] = arguments[v][E]);
return r;
}, l = {
template: "[%t] %l:",
levelFormatter: function(n) {
return n.toUpperCase();
levelFormatter: function(r) {
return r.toUpperCase();
},
nameFormatter: function(n) {
return n || "root";
nameFormatter: function(r) {
return r || "root";
},
timestampFormatter: function(n) {
return n.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1");
timestampFormatter: function(r) {
return r.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1");
},
format: void 0
}, f, l = {}, s = function(n) {
if (!n || !n.getLogger)
}, p, s = {}, u = function(r) {
if (!r || !r.getLogger)
throw new TypeError("Argument is not a root logger");
f = n;
}, a = function(n, L) {
if (!n || !n.setLevel)
p = r;
}, w = function(r, v) {
if (!r || !r.setLevel)
throw new TypeError("Argument is not a logger");
var y = n.methodFactory, w = n.name || "", V = l[w] || l[""] || u;
function c(p, d, i) {
var S = y(p, d, i), v = l[i] || l[""], x = v.template.indexOf("%t") !== -1, T = v.template.indexOf("%l") !== -1, N = v.template.indexOf("%n") !== -1;
var L = r.methodFactory, E = r.name || "", k = s[E] || s[""] || l;
function a(c, g, o) {
var x = L(c, g, o), f = s[o] || s[""], C = f.template.indexOf("%t") !== -1, S = f.template.indexOf("%l") !== -1, V = f.template.indexOf("%n") !== -1;
return function() {
for (var h = "", o = arguments.length, E = Array(o), _ = 0; _ < o; _++)
E[_] = arguments[_];
if (w || !l[i]) {
var I = v.timestampFormatter(new Date()), C = v.levelFormatter(p), D = v.nameFormatter(i);
v.format ? h += v.format(C, D, I) : (h += v.template, x && (h = h.replace(/%t/, I)), T && (h = h.replace(/%l/, C)), N && (h = h.replace(/%n/, D))), E.length && typeof E[0] == "string" ? E[0] = h + " " + E[0] : E.unshift(h);
for (var y = "", n = arguments.length, d = Array(n), m = 0; m < n; m++)
d[m] = arguments[m];
if (E || !s[o]) {
var R = f.timestampFormatter(new Date()), U = f.levelFormatter(c), A = f.nameFormatter(o);
f.format ? y += f.format(U, A, R) : (y += f.template, C && (y = y.replace(/%t/, R)), S && (y = y.replace(/%l/, U)), V && (y = y.replace(/%n/, A))), d.length && typeof d[0] == "string" ? d[0] = y + " " + d[0] : d.unshift(y);
}
S.apply(void 0, E);
x.apply(void 0, d);
};
}
return l[w] || (n.methodFactory = c), L = L || {}, L.template && (L.format = void 0), l[w] = t({}, V, L), n.setLevel(n.getLevel()), f || n.warn(
return s[E] || (r.methodFactory = a), v = v || {}, v.template && (v.format = void 0), s[E] = t({}, k, v), r.setLevel(r.getLevel()), p || r.warn(
"It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"
), n;
}, g = {
reg: s,
apply: a
}, m;
return e && (m = e.prefix, g.noConflict = function() {
return e.prefix === g && (e.prefix = m), g;
}), g;
), r;
}, h = {
reg: u,
apply: w
}, O;
return e && (O = e.prefix, h.noConflict = function() {
return e.prefix === h && (e.prefix = O), h;
}), h;
});
})(X);
class G {
})(K);
class I {
}
b(G, "LOG_LEVEL_KEY", "VITE_LOG_LEVEL"), b(G, "LOG_PREFIX_KEY", "VITE_LOG_PREFIX");
var O = /* @__PURE__ */ ((r) => (r.LOG_LEVEL_DEBUG = "DEBUG", r.LOG_LEVEL_INFO = "INFO", r.LOG_LEVEL_WARN = "WARN", r.LOG_LEVEL_ERROR = "ERROR", r))(O || {});
function z() {
const r = Error.prepareStackTrace;
Error.prepareStackTrace = (t, u) => u;
_(I, "LOG_LEVEL_KEY", "VITE_LOG_LEVEL"), _(I, "LOG_PREFIX_KEY", "VITE_LOG_PREFIX");
var F = /* @__PURE__ */ ((i) => (i.LOG_LEVEL_DEBUG = "DEBUG", i.LOG_LEVEL_INFO = "INFO", i.LOG_LEVEL_WARN = "WARN", i.LOG_LEVEL_ERROR = "ERROR", i))(F || {});
function Y() {
const i = Error.prepareStackTrace;
Error.prepareStackTrace = (t, l) => l;
const e = new Error().stack.slice(1);
return Error.prepareStackTrace = r, e;
return Error.prepareStackTrace = i, e;
}
var P = {};
(function(r) {
var e = Object.defineProperty, t = (s, a, g) => a in s ? e(s, a, { enumerable: !0, configurable: !0, writable: !0, value: g }) : s[a] = g, u = (s, a, g) => (t(s, typeof a != "symbol" ? a + "" : a, g), g);
Object.defineProperties(r, { __esModule: { value: !0 }, [Symbol.toStringTag]: { value: "Module" } });
class f {
}
u(f, "NODE_ENV_KEY", "NODE_ENV"), u(f, "VITE_DEBUG_MODE_KEY", "VITE_DEBUG_MODE");
class l {
constructor(a) {
u(this, "envMeta"), this.envMeta = a;
}
isNodeDev() {
return this.getEnv(f.NODE_ENV_KEY) === "development";
}
isDev() {
return this.isNodeDev() || this.getBooleanEnv(f.VITE_DEBUG_MODE_KEY);
}
getEnv(a) {
let g;
try {
this.envMeta[a] && (g = this.envMeta[a]);
} catch (m) {
console.error(m);
}
return g;
}
getStringEnv(a) {
return this.getEnv(a) ?? "";
}
getBooleanEnv(a) {
let g = !1;
return this.getEnv(a) && (g = this.getStringEnv(a).toLowerCase() === "true"), g;
}
getEnvOrDefault(a, g) {
const m = this.getStringEnv(a);
return m.trim().length == 0 ? g : m;
}
}
r.EnvConstants = f, r.default = l;
})(P);
const k = /* @__PURE__ */ W(P);
class U {
class G {
/**

@@ -284,3 +239,3 @@ * 解析日志级别为枚举

return e[Object.keys(e).filter(
(u) => e[u].toString() === t
(l) => e[l].toString() === t
)[0]];

@@ -294,12 +249,12 @@ }

return;
const u = new k(e).getEnvOrDefault(
G.LOG_LEVEL_KEY,
O.LOG_LEVEL_INFO
), f = U.stringToEnumValue(
O,
u.toUpperCase()
const t = e.getEnvOrDefault(
I.LOG_LEVEL_KEY,
F.LOG_LEVEL_INFO
), l = G.stringToEnumValue(
F,
t.toUpperCase()
);
return f || console.warn(
return l || console.warn(
"[zhi-log] LOG_LEVEL is invalid in you .env file.Must be either debug, info, warn or error, fallback to default info level"
), f;
), l;
}

@@ -310,8 +265,9 @@ /**

static getEnvLogger(e) {
return e ? new k(e).getEnv(G.LOG_PREFIX_KEY) : void 0;
if (e)
return e.getEnv(I.LOG_PREFIX_KEY);
}
}
class J {
constructor(e, t, u) {
b(this, "consoleLogger", "console");
class X {
constructor(e, t, l) {
_(this, "consoleLogger", "console");
/**

@@ -324,3 +280,3 @@ * 获取日志记录器

*/
b(this, "getLogger", (e) => {
_(this, "getLogger", (e) => {
let t;

@@ -330,44 +286,44 @@ if (e)

else {
const u = z(), f = [];
for (let l = 0; l < u.length; l++) {
const s = u[l], a = s.getFileName() ?? "none";
if (!a.includes(".ts") && !a.includes(".vue") && !a.includes(".tsx"))
const l = Y(), p = [];
for (let s = 0; s < l.length; s++) {
const u = l[s], w = u.getFileName() ?? "none";
if (!w.includes(".ts") && !w.includes(".vue") && !w.includes(".tsx"))
continue;
if (l > 5)
if (s > 5)
break;
const g = a + "-" + s.getLineNumber() + ":" + s.getColumnNumber();
f.push(g);
const h = w + "-" + u.getLineNumber() + ":" + u.getColumnNumber();
p.push(h);
}
u.length === 0 ? t = void 0 : t = f.join(" -> ");
l.length === 0 ? t = void 0 : t = p.join(" -> ");
}
return t = t ?? this.consoleLogger, F.getLogger(t);
return t = t ?? this.consoleLogger, b.getLogger(t);
});
let f;
e ? f = e : f = U.getEnvLevel(u), f = f ?? O.LOG_LEVEL_INFO, F.setLevel(f);
const l = {
gray: (s) => s.toString(),
green: (s) => s.toString(),
yellow: (s) => s.toString(),
red: (s) => s.toString()
let p;
e ? p = e : p = G.getEnvLevel(l), p = p ?? F.LOG_LEVEL_INFO, b.setLevel(p);
const s = {
gray: (u) => u.toString(),
green: (u) => u.toString(),
yellow: (u) => u.toString(),
red: (u) => u.toString()
};
R.reg(F), R.apply(F, {
format(s, a, g) {
const n = ["[" + (t ?? U.getEnvLogger(u) ?? "zhi") + "]"];
switch (n.push(
l.gray("[") + l.green(g).toString() + l.gray("]")
), s) {
case O.LOG_LEVEL_DEBUG:
n.push(l.gray(s.toUpperCase().toString()));
T.reg(b), T.apply(b, {
format(u, w, h) {
const r = ["[" + (t ?? G.getEnvLogger(l) ?? "zhi") + "]"];
switch (r.push(
s.gray("[") + s.green(h).toString() + s.gray("]")
), u) {
case F.LOG_LEVEL_DEBUG:
r.push(s.gray(u.toUpperCase().toString()));
break;
case O.LOG_LEVEL_INFO:
n.push(l.green(s.toUpperCase().toString()));
case F.LOG_LEVEL_INFO:
r.push(s.green(u.toUpperCase().toString()));
break;
case O.LOG_LEVEL_WARN:
n.push(l.yellow(s.toUpperCase().toString()));
case F.LOG_LEVEL_WARN:
r.push(s.yellow(u.toUpperCase().toString()));
break;
case O.LOG_LEVEL_ERROR:
n.push(l.red(s.toUpperCase().toString()));
case F.LOG_LEVEL_ERROR:
r.push(s.red(u.toUpperCase().toString()));
break;
}
return n.push(l.green(a).toString()), n.push(l.gray(":")), n.join(" ");
return r.push(s.green(w).toString()), r.push(s.gray(":")), r.join(" ");
}

@@ -377,3 +333,3 @@ });

}
class $ {
class z {
/**

@@ -384,7 +340,7 @@ * 默认日志级别

* @param sign - 可选前缀,默认zhi
* @param envMeta - 可选环境变量元数据
* @param env - 可选环境变量实例
*/
constructor(e, t, u) {
b(this, "log");
this.log = new J(e, t, u);
constructor(e, t, l) {
_(this, "log");
this.log = new X(e, t, l);
}

@@ -401,5 +357,5 @@ /**

}
class M extends $ {
constructor(e, t, u) {
super(e, t, u);
class N extends z {
constructor(e, t, l) {
super(e, t, l);
}

@@ -415,10 +371,10 @@ /**

}
class B {
class M {
/**
* 默认日志记录器
*
* @param envMeta - 可选环境变量元数据,特别注意:如果需要使用环境变量控制日志,请务必传递 {"BASE_URL":"/","MODE":"production","DEV":false,"PROD":true,"SSR":false}
* @param env - 环境变量实例
*/
static defaultLogger(e) {
return B.customLogFactory(void 0, void 0, e).getLogger();
return M.customLogFactory(void 0, void 0, e).getLogger();
}

@@ -428,4 +384,4 @@ /**

*/
static customLogFactory(e, t, u) {
return new M(e, t, u);
static customLogFactory(e, t, l) {
return new N(e, t, l);
}

@@ -436,10 +392,10 @@ /**

static customSignLogFactory(e, t) {
return new M(void 0, e, t);
return new N(void 0, e, t);
}
}
export {
M as CustomLogFactory,
$ as LogFactory,
O as LogLevelEnum,
B as default
N as CustomLogFactory,
z as LogFactory,
F as LogLevelEnum,
M as default
};
import LogFactory from '../../src/factory/logFactory';
import LogLevelEnum from '../../src/logConstants';
import DefaultLogger from '../../src/logger';
import Env from "zhi-env";
/**

@@ -12,3 +13,3 @@ * 自定义日志工厂

declare class CustomLogFactory extends LogFactory {
constructor(level?: LogLevelEnum, sign?: string, envMeta?: any);
constructor(level?: LogLevelEnum, sign?: string, env?: Env);
/**

@@ -15,0 +16,0 @@ * 获取默认的日志记录器

import LogLevelEnum from '../../src/logConstants';
import DefaultLogger from '../../src/logger';
import Env from "zhi-env";
/**

@@ -17,5 +18,5 @@ * 日志记录工厂

* @param sign - 可选前缀,默认zhi
* @param envMeta - 可选环境变量元数据
* @param env - 可选环境变量实例
*/
protected constructor(level?: LogLevelEnum, sign?: string, envMeta?: any);
protected constructor(level?: LogLevelEnum, sign?: string, env?: Env);
/**

@@ -22,0 +23,0 @@ * 获取日志记录器

{
"name": "zhi-log",
"version": "1.5.2",
"version": "1.5.3",
"description": "a simple logger for Node and Browser",

@@ -67,4 +67,4 @@ "files": [

"loglevel-plugin-prefix": "^0.8.4",
"zhi-env": "^1.8.1"
"zhi-env": "^1.8.2"
}
}

@@ -13,3 +13,4 @@ # zhi-log

const logger = LogUtil.defaultLogger()
const env = new Env(import.meta.env)
const logger = LogUtil.defaultLogger(env)
logger.debug("debug msg")

@@ -16,0 +17,0 @@ logger.info("info msg")

@@ -6,2 +6,3 @@ /**

import Env from "zhi-env"
import { Logger } from "loglevel"

@@ -17,3 +18,3 @@

export declare class CustomLogFactory extends LogFactory {
constructor(level?: LogLevelEnum, sign?: string, envMeta?: any)
constructor(level?: LogLevelEnum, sign?: string, env?: Env)
/**

@@ -92,5 +93,5 @@ * 获取默认的日志记录器

* @param sign - 可选前缀,默认zhi
* @param envMeta - 可选环境变量元数据
* @param env - 可选环境变量实例
*/
protected constructor(level?: LogLevelEnum, sign?: string, envMeta?: any)
protected constructor(level?: LogLevelEnum, sign?: string, env?: Env)
/**

@@ -142,5 +143,5 @@ * 获取日志记录器

*
* @param envMeta - 可选环境变量元数据,特别注意:如果需要使用环境变量控制日志,请务必传递 import.meta.env
* @param env - 环境变量实例
*/
static defaultLogger(envMeta?: any): DefaultLogger
static defaultLogger(env?: Env): DefaultLogger
/**

@@ -152,3 +153,3 @@ * 自定义日志工厂

sign?: string,
envMeta?: any
env?: Env
): CustomLogFactory

@@ -158,3 +159,3 @@ /**

*/
static customSignLogFactory(sign?: string, envMeta?: any): CustomLogFactory
static customSignLogFactory(sign?: string, env?: Env): CustomLogFactory
}

@@ -161,0 +162,0 @@ export default LogUtil

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc