194f5b7a1Sopenharmony_ci/* 294f5b7a1Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 394f5b7a1Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 494f5b7a1Sopenharmony_ci * you may not use this file except in compliance with the License. 594f5b7a1Sopenharmony_ci * You may obtain a copy of the License at 694f5b7a1Sopenharmony_ci * 794f5b7a1Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 894f5b7a1Sopenharmony_ci * 994f5b7a1Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1094f5b7a1Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1194f5b7a1Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1294f5b7a1Sopenharmony_ci * See the License for the specific language governing permissions and 1394f5b7a1Sopenharmony_ci * limitations under the License. 1494f5b7a1Sopenharmony_ci */ 1594f5b7a1Sopenharmony_ci 1694f5b7a1Sopenharmony_ciimport hiLog from '@ohos.hilog'; 1794f5b7a1Sopenharmony_ci 1894f5b7a1Sopenharmony_ciconst TAG = 'ScreenShot-Default'; 1994f5b7a1Sopenharmony_ciconst DOMAIN = 0x55EE; 2094f5b7a1Sopenharmony_ciconst FORMAT = '%{public}s'; 2194f5b7a1Sopenharmony_ciconst PREFIX = '[Screenshot]'; 2294f5b7a1Sopenharmony_ciconst SEPARATOR = ' '; 2394f5b7a1Sopenharmony_ci 2494f5b7a1Sopenharmony_ci/** 2594f5b7a1Sopenharmony_ci * Basic log class 2694f5b7a1Sopenharmony_ci */ 2794f5b7a1Sopenharmony_ciexport default class Log { 2894f5b7a1Sopenharmony_ci /** 2994f5b7a1Sopenharmony_ci * print info level log 3094f5b7a1Sopenharmony_ci * 3194f5b7a1Sopenharmony_ci * @param {string} tag - Page or class tag 3294f5b7a1Sopenharmony_ci * @param {string} log - Log needs to be printed 3394f5b7a1Sopenharmony_ci */ 3494f5b7a1Sopenharmony_ci static showInfo(tag: string, ...args: string[]) { 3594f5b7a1Sopenharmony_ci hiLog.info(DOMAIN, PREFIX, FORMAT, `tag: ${tag} --> ${args.join(SEPARATOR)}`); 3694f5b7a1Sopenharmony_ci } 3794f5b7a1Sopenharmony_ci 3894f5b7a1Sopenharmony_ci /** 3994f5b7a1Sopenharmony_ci * print debug level log 4094f5b7a1Sopenharmony_ci * 4194f5b7a1Sopenharmony_ci * @param {string} tag - Page or class tag 4294f5b7a1Sopenharmony_ci * @param {string} log - Log needs to be printed 4394f5b7a1Sopenharmony_ci */ 4494f5b7a1Sopenharmony_ci static showDebug(tag: string, ...args: string[]) { 4594f5b7a1Sopenharmony_ci hiLog.debug(DOMAIN, PREFIX, FORMAT, `tag: ${tag} --> ${args.join(SEPARATOR)}`); 4694f5b7a1Sopenharmony_ci } 4794f5b7a1Sopenharmony_ci 4894f5b7a1Sopenharmony_ci /** 4994f5b7a1Sopenharmony_ci * print error level log 5094f5b7a1Sopenharmony_ci * 5194f5b7a1Sopenharmony_ci * @param {string} tag - Page or class tag 5294f5b7a1Sopenharmony_ci * @param {string} log - Log needs to be printed 5394f5b7a1Sopenharmony_ci */ 5494f5b7a1Sopenharmony_ci static showError(tag: string, ...args: string[]) { 5594f5b7a1Sopenharmony_ci hiLog.error(DOMAIN, PREFIX, FORMAT, `tag: ${tag} --> ${args.join(SEPARATOR)}`); 5694f5b7a1Sopenharmony_ci } 5794f5b7a1Sopenharmony_ci} 58