package com.example.bpa.helper;

import com.example.bpa.Model.IMessageLogNotify;

import java.text.SimpleDateFormat;
import java.util.Date;

public class MessageLog {
    public static IMessageLogNotify MsgNotify;

    public static void ShowInfo(String msg) {
        SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
        Date date = new Date();
        if (MsgNotify != null)
            MsgNotify.InfoMsg(formatter.format(date) + "：" + msg);
    }

    public static void ShowWarning(String msg) {
        SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
        Date date = new Date();
        if (MsgNotify != null)
            MsgNotify.WarnMsg(formatter.format(date) + "：" + msg);
    }

    public static void ShowError(String msg) {
        SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
        Date date = new Date();
        if (MsgNotify != null)
            MsgNotify.ErrorMsg(formatter.format(date) + "：" + msg);
    }
}
