1/**
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * Log Util
18 *
19 * standard:
20 * 1. define TAG, recommend class name.
21 * 2. switch IS_DEBUG_ON as true, when debugging.
22 * 3. msg should be short and valuable.
23 * 4. choose appropriate function.
24 * 5. the function execute many times can not print.
25 * 6. uniqueness.
26 */
27
28/**
29 *  log package tool class
30 */
31export class LogUtils {
32  d(TAG, msg): void {
33    console.debug('[mobiledatasettings:]' + TAG + ':' + msg);
34  }
35
36  i(TAG, msg): void {
37    console.info('[mobiledatasettings:]' + TAG + ':' + msg);
38  }
39
40  w(TAG, msg): void {
41    console.warn('[mobiledatasettings:]' + TAG + ':' + msg);
42  }
43
44  e(TAG, msg): void {
45    console.error('[mobiledatasettings:]' + TAG + ':' + msg);
46  }
47}
48
49let mLogUtil = new LogUtils();
50
51export default mLogUtil as LogUtils;
52
53