<?php
/**
 * Created by PhpStorm.
 * User: sunmoon
 * Date: 2018/6/4
 * Time: 下午2:36
 */

namespace console\helpers;
use Yii;
class Logger {
    /**
     * error
     * @param $message
     * @param $category
     */
    public static function error($message, $category = 'application'){
        Yii::getLogger()->flush(true);
        return Yii::error($message, $category);
    }

    /**
     * info
     * @param $message
     * @param $category
     */
    public static function info($message, $category = 'application'){
        Yii::getLogger()->flush(true);
        return Yii::info($message, $category);
    }

    /**
     * warning
     * @param $message
     * @param $category
     */
    public static function warning($message, $category = 'application'){
        Yii::getLogger()->flush(true);
        return Yii::warning($message, $category);
    }

    /**
     * trace
     * @param $message
     * @param $category
     */
    public static function trace($message, $category = 'application'){
        Yii::getLogger()->flush(true);
        return Yii::debug($message, $category);
    }
}