Add LifeCycleLogLabel Test Case Modular and Manager, Merge Logger to core #7

Merged
MrKBear merged 3 commits from dev-mrkbear into master 2021-12-01 10:55:55 +08:00
Showing only changes of commit cea68f5145 - Show all commits

View File

@ -0,0 +1,83 @@
import { LogStyle } from "./LogStyle";
import { LogLabel } from "./LogLabel";
/**
*
*/
const normalStyleGen = (r:number, g:number, b:number):LogStyle => {
return new LogStyle().setBorder("4px", `1px solid rgb(${ r }, ${ g }, ${ b })`)
.setColor(`rgb(${ r }, ${ g }, ${ b })`, `rgba(${ r }, ${ g }, ${ b }, .1)`)
.setBlank("0 5px");
}
/**
*
*/
class LifeCycleLogLabel {
/**
*
*/
static readonly OnLaunchLabel = new LogLabel(
"onLaunch", normalStyleGen(160, 32, 240)
);
/**
* --
*/
static readonly OnLoadLabel = new LogLabel(
"onLoad", normalStyleGen(255, 140, 105)
);
/**
* --
*/
static readonly OnReadyLabel = new LogLabel(
"onReady", normalStyleGen(255, 127, 36)
);
/**
* --
*/
static readonly OnShowLabel = new LogLabel(
"onShow", normalStyleGen(255, 215, 0)
)
/**
* --
*/
static readonly OnHideLabel = new LogLabel(
"onHide", normalStyleGen(173, 255, 47)
);
/**
* --
*/
static readonly OnUnloadLabel = new LogLabel(
"onUnload", normalStyleGen(127, 255, 212)
);
/**
* --
*/
static readonly OnPullDownRefreshLabel = new LogLabel(
"onPullDownRefresh", normalStyleGen(0, 191, 255)
);
/**
*
*/
static readonly OnReachBottomLabel = new LogLabel(
"onReachBottom", normalStyleGen(84, 255, 159)
);
/**
*
*/
static readonly OnShareAppMessageLabel = new LogLabel(
"onShareAppMessage", normalStyleGen(147, 112, 219)
);
}
export default LifeCycleLogLabel;
export { LifeCycleLogLabel };