| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package com.fujica.abk.utils;
- import ohos.hiviewdfx.HiLog;
- import ohos.hiviewdfx.HiLogLabel;
- public class Log {
- private static final HiLogLabel TAG = new HiLogLabel(HiLog.DEBUG, 0x0, "fspark log");
- public static void error(String message) {
- System.err.println("fspark log: " + message);
- }
- public static void error(Exception e) {
- System.err.println("fspark log: " + e.getMessage() != null ? e.getMessage() : e.toString());
- e.printStackTrace();
- }
- public static void error(Throwable e) {
- System.err.println("fspark log: " + e.getMessage() != null ? e.getMessage() : e.toString());
- e.printStackTrace();
- }
- public static void info(String message) {
- System.err.println("fspark log: " + message);
- }
- public static void warn(String message) {
- HiLog.warn(TAG, message);
- }
- // public static error(message: string | ESObject): void {
- // const msg: string = (message && typeof (message) == 'object') ? JSON.stringify(message) : (message || '').toString()
- // console.error(`fspark log:${msg}`);
- // }
- //
- // public static info(message: string | ESObject): void {
- // const msg: string = (message && typeof (message) == 'object') ? JSON.stringify(message) : (message || '').toString()
- // console.info(`fspark log:${msg}`);
- // }
- //
- // public static debug(message: string | ESObject): void {
- // const msg: string = (message && typeof (message) == 'object') ? JSON.stringify(message) : (message || '').toString()
- // console.debug(`fspark log:${msg}`);
- // }
- }
|