This repository has been archived by the owner on Oct 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a03c4bd
commit 112c376
Showing
12 changed files
with
149 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { sealed } from "./src"; | ||
export { sealed, LoggerType } from "./src"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { sealed } from "./decorators"; | ||
export { LoggerType } from "./logging"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { LoggerType } from "./logger-type"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// ************************************************************************************************************************** | ||
// COPYRIGHT © 2006 - 2022 WANG YUCAI. ALL RIGHTS RESERVED. | ||
// LICENSED UNDER THE MIT LICENSE. SEE LICENSE FILE IN THE PROJECT ROOT FOR FULL LICENSE INFORMATION. | ||
// ************************************************************************************************************************** | ||
export { LoggerType } from "./logger-type"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* 定义了日志类型枚举。 | ||
* | ||
* @export | ||
* @enum {number} | ||
*/ | ||
export declare enum LoggerType { | ||
/** | ||
* 追踪型日志。 | ||
*/ | ||
TRACE = 1, | ||
/** | ||
* 调试型日志。 | ||
*/ | ||
DEBUG = 2, | ||
/** | ||
* 信息型日志。 | ||
*/ | ||
INFO = 4, | ||
/** | ||
* 警告型日志。 | ||
*/ | ||
WARN = 8, | ||
/** | ||
* 错误型日志。 | ||
*/ | ||
ERROR = 16 | ||
} | ||
/** | ||
* 为 LoggerType 类型提供的扩展方法。 | ||
*/ | ||
export declare namespace LoggerType { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// ************************************************************************************************************************** | ||
// COPYRIGHT © 2006 - 2022 WANG YUCAI. ALL RIGHTS RESERVED. | ||
// LICENSED UNDER THE MIT LICENSE. SEE LICENSE FILE IN THE PROJECT ROOT FOR FULL LICENSE INFORMATION. | ||
// ************************************************************************************************************************** | ||
/** | ||
* 定义了日志类型枚举。 | ||
* | ||
* @export | ||
* @enum {number} | ||
*/ | ||
export var LoggerType; | ||
(function (LoggerType) { | ||
/** | ||
* 追踪型日志。 | ||
*/ | ||
LoggerType[LoggerType["TRACE"] = 1] = "TRACE"; | ||
/** | ||
* 调试型日志。 | ||
*/ | ||
LoggerType[LoggerType["DEBUG"] = 2] = "DEBUG"; | ||
/** | ||
* 信息型日志。 | ||
*/ | ||
LoggerType[LoggerType["INFO"] = 4] = "INFO"; | ||
/** | ||
* 警告型日志。 | ||
*/ | ||
LoggerType[LoggerType["WARN"] = 8] = "WARN"; | ||
/** | ||
* 错误型日志。 | ||
*/ | ||
LoggerType[LoggerType["ERROR"] = 16] = "ERROR"; | ||
})(LoggerType || (LoggerType = {})); | ||
/** | ||
* 为 LoggerType 类型提供的扩展方法。 | ||
*/ | ||
(function (LoggerType) { | ||
/** | ||
* 用于校验 source 是否等于 target 值。 | ||
* | ||
* @param {(LoggerType | number)} source 需要对比的源值。 | ||
* @param {(LoggerType | number)} target 需要对比的目标值。 | ||
* @returns {boolean} | ||
*/ | ||
function equals(source, target) { | ||
return (source & target) === target; | ||
} | ||
})(LoggerType || (LoggerType = {})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// ************************************************************************************************************************** | ||
// COPYRIGHT © 2006 - 2022 WANG YUCAI. ALL RIGHTS RESERVED. | ||
// LICENSED UNDER THE MIT LICENSE. SEE LICENSE FILE IN THE PROJECT ROOT FOR FULL LICENSE INFORMATION. | ||
// ************************************************************************************************************************** | ||
|
||
export { LoggerType } from "./logger-type"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// ************************************************************************************************************************** | ||
// COPYRIGHT © 2006 - 2022 WANG YUCAI. ALL RIGHTS RESERVED. | ||
// LICENSED UNDER THE MIT LICENSE. SEE LICENSE FILE IN THE PROJECT ROOT FOR FULL LICENSE INFORMATION. | ||
// ************************************************************************************************************************** | ||
|
||
/** | ||
* 定义了日志类型枚举。 | ||
* | ||
* @export | ||
* @enum {number} | ||
*/ | ||
export enum LoggerType { | ||
/** | ||
* 追踪型日志。 | ||
*/ | ||
TRACE = 1, | ||
/** | ||
* 调试型日志。 | ||
*/ | ||
DEBUG = 2, | ||
/** | ||
* 信息型日志。 | ||
*/ | ||
INFO = 4, | ||
/** | ||
* 警告型日志。 | ||
*/ | ||
WARN = 8, | ||
/** | ||
* 错误型日志。 | ||
*/ | ||
ERROR = 16 | ||
} | ||
|
||
/** | ||
* 为 LoggerType 类型提供的扩展方法。 | ||
*/ | ||
export namespace LoggerType { | ||
/** | ||
* 用于校验 source 是否等于 target 值。 | ||
* | ||
* @param {(LoggerType | number)} source 需要对比的源值。 | ||
* @param {(LoggerType | number)} target 需要对比的目标值。 | ||
* @returns {boolean} | ||
*/ | ||
function equals(source: LoggerType | number, target: LoggerType | number): boolean { | ||
return (source & target) === target; | ||
} | ||
} |