1/** 2 * @file Describe the file 3 * Copyright (c) 2023 Huawei Device Co., Ltd. 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17const TAG = 'CalendarData'; 18 19/** 20 * Global Log class 21 * 22 * @since 2022-04-13 23 */ 24export class Log { 25 public static log(classTag: string, msg: string) { 26 console.log(TAG + "--" + classTag + ":" + msg); 27 } 28 29 public static debug(classTag: string, msg: string) { 30 console.debug(TAG + "--" + classTag + ":" + msg); 31 } 32 33 public static info(classTag: string, msg: string) { 34 console.info(TAG + "--" + classTag + ":" + msg); 35 } 36 37 public static warn(classTag: string, msg: string) { 38 console.warn(TAG + "--" + classTag + ":" + msg); 39 } 40 41 public static error(classTag: string, msg: string) { 42 console.error(TAG + "--" + classTag + ":" + msg); 43 } 44 45 public static stringify(data: object): string { 46 return JSON.stringify(data, null, 4); 47 } 48} 49