mirror of
https://gitee.com/openharmony/applications_screenshot
synced 2024-11-23 06:59:48 +00:00
update common/src/main/ets/default/Log.ets.
Signed-off-by: 吕布布的耳朵 <shengli9@huawei.com>
This commit is contained in:
parent
137e1365c2
commit
1541c03e1a
@ -13,22 +13,26 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const TAG = 'ScreenShot-Default';
|
||||
import hiLog from '@ohos.hilog';
|
||||
|
||||
const TAG = 'ScreenShot-Default';
|
||||
const DOMAIN = 0x55EE;
|
||||
const FORMAT = '%{public}s';
|
||||
const PREFIX = '[Screenshot]';
|
||||
const SEPARATOR = ' ';
|
||||
|
||||
/**
|
||||
* Basic log class
|
||||
*/
|
||||
export default class Log {
|
||||
|
||||
/**
|
||||
* print info level log
|
||||
*
|
||||
* @param {string} tag - Page or class tag
|
||||
* @param {string} log - Log needs to be printed
|
||||
*/
|
||||
static showInfo(tag, log) {
|
||||
console.info(`${TAG} tag: ${tag} --> ${log}`);
|
||||
static showInfo(tag, ...args: any[]) {
|
||||
hiLog.info(DOMAIN, PREFIX, FORMAT, `tag: ${tag} --> ${args.join(SEPARATOR)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -37,8 +41,8 @@ export default class Log {
|
||||
* @param {string} tag - Page or class tag
|
||||
* @param {string} log - Log needs to be printed
|
||||
*/
|
||||
static showDebug(tag, log) {
|
||||
console.debug(`${TAG} tag: ${tag} --> ${log}`);
|
||||
static showDebug(tag, ...args: any[]) {
|
||||
hiLog.debug(DOMAIN, PREFIX, FORMAT, `tag: ${tag} --> ${args.join(SEPARATOR)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -47,7 +51,8 @@ export default class Log {
|
||||
* @param {string} tag - Page or class tag
|
||||
* @param {string} log - Log needs to be printed
|
||||
*/
|
||||
static showError(tag, log) {
|
||||
console.error(`${TAG} tag: ${tag} --> ${log}`);
|
||||
static showError(tag, ...args: any[]) {
|
||||
hiLog.error(DOMAIN, PREFIX, FORMAT, `tag: ${tag} --> ${args.join(SEPARATOR)}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user