public override void Log(string message, CustomLogType type, string addtionalInfo)
        {
            switch (type)
            {
            case CustomLogType.Error:
                LogHelper.log.Error(message);
                LogHelper.log.Error(addtionalInfo);
                break;

            case CustomLogType.Info:
                LogHelper.log.Info(message);
                LogHelper.log.Info(addtionalInfo);
                break;

            case CustomLogType.Fatal:
                LogHelper.log.Fatal(message);
                LogHelper.log.Fatal(addtionalInfo);
                break;

            case CustomLogType.Warning:
                LogHelper.log.Warn(message);
                LogHelper.log.Warn(addtionalInfo);
                break;

            default:
                LogHelper.log.Info(message);
                LogHelper.log.Info(addtionalInfo);
                break;
            }
        }
        public TestException(string scenarioName, CustomLogType logType, string info, string screenshotFileName = null)
        {
            LogHelper.WriteToLog("Test Scenario Name: " + scenarioName, logType);
            LogHelper.WriteToLog(info, logType);

            if (screenshotFileName != null)
            {
                string screenshotFilePath = BrowserScreenshot.CaptureBrowserScreenshot(screenshotFileName);
                LogHelper.WriteToLog("Screenshot added to loaction : " + screenshotFilePath, logType);
                TestContext.WriteLine("Screenshot added to loaction : " + screenshotFilePath);
            }
            //Write to Nunit Test Context so that it can be written to Nunit TestReprt.xml
            TestContext.WriteLine(info);
        }
 public TestException(string scenarioName, CustomLogType logType, string info, string additionalInfo = null, string furtherAdditionalInfo = null)
 {
     LogHelper.WriteToLog("Test Scenario Name: " + scenarioName, logType);
     LogHelper.WriteToLog(info, logType);
     if (additionalInfo != null)
     {
         LogHelper.WriteToLog(additionalInfo, logType);
         TestContext.WriteLine(additionalInfo);
     }
     if (furtherAdditionalInfo != null)
     {
         LogHelper.WriteToLog(furtherAdditionalInfo, logType);
         TestContext.WriteLine(furtherAdditionalInfo);
     }
     //Write to Nunit Test Context so that it can be written to Nunit TestReprt.xml
     TestContext.WriteLine(info);
 }
Example #4
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;
            }
        }
Example #5
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;
            }
        }
    static void OnDebugCallback(IntPtr request, CustomLogType logType, int size)
    {
        string logMsg = Marshal.PtrToStringAnsi(request, size);

        logMsg = $"<color=green>NativeLog:</color> {logMsg}";

        switch (logType)
        {
        case CustomLogType.Warning:
            Debug.LogWarning(logMsg);
            break;

        case CustomLogType.Error:
            Debug.LogError(logMsg);
            break;

        default:
            Debug.Log(logMsg);
            break;
        }
    }
Example #7
0
 public abstract void Log(string message, CustomLogType type, string addtionalInfo);
Example #8
0
 public abstract void Log(string message, CustomLogType type);