Esempio n. 1
0
        public void Handler(Recoder recoder)
        {
            string detailLog = "";

            detailLog = recoder.time + " " + recoder.tag + " " + recoder.loglevel + " " + recoder.msg;

            HandlerLog(detailLog);
        }
        public void Logger(string tag, string content, LogLevel level)
        {
            if (string.IsNullOrEmpty(tag))
            {
                tag = "";
            }

            Recoder recoder = new Recoder
            {
                time     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                tag      = tag,
                msg      = content,
                loglevel = getLogLevelString(level),
            };

            foreach (IGuLogHandler logger in LoggerSet)
            {
                logger.Handler(recoder);
            }
        }