|
@@ -14,7 +14,7 @@ const aliLogger = new SlsWebLogger({
|
|
|
|
|
|
type LogDetail = {
|
|
|
/** default log */
|
|
|
- level?: "debug" | "log" | "warn" | "error";
|
|
|
+ lvl?: "debug" | "log" | "warn" | "error";
|
|
|
/** channels. 往哪些渠道放日志? default: ['console'] */
|
|
|
cnl: ("console" | "local" | "server" | "bd")[];
|
|
|
/** 操作的类型,方便在日志里面查找相同类型的操作 */
|
|
@@ -58,7 +58,7 @@ export default function createLog(detail: LogDetail) {
|
|
|
const defaultFileds = {
|
|
|
/** 供灰度发布识别日志 */
|
|
|
__ver: "3.0.0",
|
|
|
- level: "log",
|
|
|
+ lvl: "log",
|
|
|
uuidForEcs: localStorage.getItem("uuidForEcs"),
|
|
|
clientDate: moment().format("YYYY-MM-DD HH:mm:ss.SSS"),
|
|
|
...(user?.id ? { userId: user.id } : {}),
|
|
@@ -70,13 +70,13 @@ export default function createLog(detail: LogDetail) {
|
|
|
detail.ext
|
|
|
);
|
|
|
// FIXME: 后期设置条件开启非log级别的日志,此时全部打回。
|
|
|
- if (newDetail.level !== "log") {
|
|
|
+ if (newDetail.lvl !== "log") {
|
|
|
return;
|
|
|
}
|
|
|
if (detail.cnl?.includes("console")) {
|
|
|
if (import.meta.env.DEV) {
|
|
|
console.log(
|
|
|
- omit(newDetail, ["__ver", "cnl", "level", "uuidForEcs", "clientDate"])
|
|
|
+ omit(newDetail, ["__ver", "cnl", "lvl", "uuidForEcs", "clientDate"])
|
|
|
);
|
|
|
} else {
|
|
|
console.log(newDetail);
|