示例#1
0
        public static void WriteToLog(string message, CustomLogType logType)
        {
            switch (Settings.TestLogTarget)
            {
            case LogTarget.Log4Net:
                if (logger is null)
                {
                    logger = new LogFourNetManager();
                }
                logger.Log(message, logType);
                break;

            case LogTarget.Text:
                break;

            default:
                break;
            }
        }
示例#2
0
        public static void WriteToLog(object obj, string exceptionMessage)
        {
            switch (Settings.TestLogTarget)
            {
            case LogTarget.Log4Net:
                if (logger is null)
                {
                    logger = new LogFourNetManager();
                }
                logger.Log(DateTime.Now.ToString("yyyyMMdd-HH.mm.ss") + ":  " + obj + ":  " + exceptionMessage);
                break;

            case LogTarget.Text:
                break;

            default:
                break;
            }
        }
示例#3
0
        public static void WriteToLog(string message, CustomLogType logType, string addtionalInfo, string screenShotFileName)
        {
            switch (Settings.TestLogTarget)
            {
            case LogTarget.Log4Net:
                if (logger is null)
                {
                    logger = new LogFourNetManager();
                }
                logger.Log(message, logType, addtionalInfo);
                string screenshotFilePath = BrowserScreenshot.CaptureBrowserScreenshot(screenShotFileName);
                logger.Log("Screenshot added to loaction : " + screenshotFilePath, logType);
                break;

            case LogTarget.Text:
                break;

            default:
                break;
            }
        }