mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-03 10:14:34 +08:00
refactor: logger
This commit is contained in:
1 parent
bd432af00a
commit
b06c346b56
22 files changed
+130
-290
No files matched your search
@@ -48,10 +48,7 @@ export class LayerGroupFilter implements ILayerGroupRenderExtends {
|
||||
this.binder = ex;
|
||||
this.listen();
|
||||
} else {
|
||||
logger.error(
|
||||
1201,
|
||||
`Floor-damage extends needs 'floor-binder' extends as dependency.`
|
||||
);
|
||||
logger.error(1201);
|
||||
group.removeExtends('floor-damage');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,10 +28,7 @@ export class LayerGroupHalo implements ILayerGroupRenderExtends {
|
||||
this.halo.binder = ex;
|
||||
group.appendChild(this.halo);
|
||||
} else {
|
||||
logger.error(
|
||||
1401,
|
||||
`Halo extends needs 'floor-binder' extends as dependency.`
|
||||
);
|
||||
logger.error(1401);
|
||||
group.removeExtends('halo');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,10 +257,7 @@ export class FloorItemDetail implements ILayerGroupRenderExtends {
|
||||
this.listen();
|
||||
FloorItemDetail.listened.add(this);
|
||||
} else {
|
||||
logger.warn(
|
||||
1001,
|
||||
`Item-detail extends needs 'floor-binder' and 'floor-damage' as dependency`
|
||||
);
|
||||
logger.warn(1001);
|
||||
group.removeExtends('item-detail');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,10 +44,7 @@ export class LayerGroupPortal implements ILayerGroupRenderExtends {
|
||||
group.appendChild(this.portal);
|
||||
this.listen();
|
||||
} else {
|
||||
logger.error(
|
||||
1301,
|
||||
`Portal extends need 'floor-binder' extends as dependency.`
|
||||
);
|
||||
logger.error(1301);
|
||||
group.removeExtends('portal');
|
||||
}
|
||||
}
|
||||
|
||||
+5
-20
@@ -108,10 +108,7 @@ export function parseCss(css: string): Partial<Record<CanParseCss, string>> {
|
||||
|
||||
if (char === ':') {
|
||||
if (!inProp) {
|
||||
logger.error(
|
||||
3,
|
||||
`Syntax error in parsing CSS: Unexpected ':'. Col: ${pointer}. CSS string: '${css}'`
|
||||
);
|
||||
logger.error(3, pointer.toString(), css);
|
||||
return res;
|
||||
}
|
||||
inProp = false;
|
||||
@@ -121,10 +118,7 @@ export function parseCss(css: string): Partial<Record<CanParseCss, string>> {
|
||||
if (char === ';') {
|
||||
if (prop.length === 0) continue;
|
||||
if (inProp) {
|
||||
logger.error(
|
||||
4,
|
||||
`Syntax error in parsing CSS: Unexpected ';'. Col: ${pointer}. CSS string: '${css}'`
|
||||
);
|
||||
logger.error(4, pointer.toString(), css);
|
||||
return res;
|
||||
}
|
||||
res[prop as CanParseCss] = value.trim();
|
||||
@@ -136,10 +130,7 @@ export function parseCss(css: string): Partial<Record<CanParseCss, string>> {
|
||||
|
||||
if (upper) {
|
||||
if (!inProp) {
|
||||
logger.error(
|
||||
5,
|
||||
`Syntax error in parsing CSS: Missing property name after '-'. Col: ${pointer}. CSS string: '${css}'`
|
||||
);
|
||||
logger.error(5, pointer.toString(), css);
|
||||
}
|
||||
prop += char.toUpperCase();
|
||||
upper = false;
|
||||
@@ -149,17 +140,11 @@ export function parseCss(css: string): Partial<Record<CanParseCss, string>> {
|
||||
}
|
||||
}
|
||||
if (inProp && prop.length > 0) {
|
||||
logger.error(
|
||||
6,
|
||||
`Syntax error in parsing CSS: Unexpected end of css, expecting ':'. Col: ${pointer}. CSS string: '${css}'`
|
||||
);
|
||||
logger.error(6, pointer.toString(), css);
|
||||
return res;
|
||||
}
|
||||
if (!inProp && value.trim().length === 0) {
|
||||
logger.error(
|
||||
7,
|
||||
`Syntax error in parsing CSS: Unexpected end of css, expecting property value. Col: ${pointer}. CSS string: '${css}'`
|
||||
);
|
||||
logger.error(7, pointer.toString(), css);
|
||||
return res;
|
||||
}
|
||||
if (prop.length > 0) res[prop as CanParseCss] = value.trim();
|
||||
|
||||
Reference in new issue
Block a user