import { _decorator} from 'cc';
import { GameConst } from '../common/GameConst';
const { ccclass, property } = _decorator;

@ccclass('Logger')
export class Logger{

    //静态方法来控制日志输出
    public static error(message: string, ...optionalParams: any[]): void {
        if(GameConst.isDebug) {
            console.error(message, ...optionalParams);
        }
    }

    public static log(message: string, ...optionalParams: any[]): void {
        if(GameConst.isDebug) {
            console.log(message, ...optionalParams);
        }
    }

    public static warn(message: string, ...optionalParams: any[]): void {
        if(GameConst.isDebug) {
            console.warn(message, ...optionalParams);
        }
    }
}

