示例#1
0
        public static void Log(LogTarget target, string message)
        {
            switch (target)
            {
            case LogTarget.File:
                logger = new FileLogger("Logger.txt");
                logger.Log(message);
                break;

            case LogTarget.Console:
                logger = new ConsoleLogger();
                logger.Log(message);
                break;

            case LogTarget.EventLog:
                logger = new EventLogger();
                logger.Log(message);
                break;

            default:
                return;
            }
        }
示例#2
0
            public static void Log(LogTarget target, string message, Level level)
            {
                switch (target)
                {
                case LogTarget.File:
                    logger = new FileLogger(@"C:\Users\accountant.AHM\Desktop\testsig\pdfin");
                    logger.Log(message, level);
                    break;

                case LogTarget.Database:
                    logger = new DBLogger();
                    logger.Log(message, level);
                    break;

                case LogTarget.EventLog:
                    logger = new EventLogger();
                    logger.Log(message, level);
                    break;

                default:
                    return;
                }
            }
示例#3
0
 public static void Log(Level level, string message)
 {
     logger.Log(level, message);
 }
示例#4
0
 public static void Log(string fileName, string message)
 {
     Logger.Log(fileName, message);
 }