public void BonCodeAJP13LoggerConstructorTest() { string fileName = string.Empty; // TODO: Initialize to an appropriate value Mutex loggerMutex = null; // TODO: Initialize to an appropriate value BonCodeAJP13Logger target = new BonCodeAJP13Logger(fileName, loggerMutex); Assert.Inconclusive("TODO: Implement code to verify target"); }
/// <summary> /// prep logging facilities /// </summary> private void CheckMutex() { if (BonCodeAJP13Settings.BONCODEAJP13_LOG_LEVEL > BonCodeAJP13LogLevels.BONCODEAJP13_NO_LOG) { p_Logger = new BonCodeAJP13Logger("BonCodeAJP13ConnectionLog.txt", p_ConnectionMutex); } }
/// <summary> /// prep logging facilities /// </summary> private void CheckMutex() { if (BonCodeAJP13Settings.BONCODEAJP13_LOG_LEVEL > BonCodeAJP13LogLevels.BONCODEAJP13_NO_LOG) { bool initLogger = true; string errMsg = ""; //if we have a log filter we need to satisfy it first, in that case only log when we have a match pattern if (BonCodeAJP13Settings.BONCODEAJP13_LOG_IPFILTER.Length > 0 && p_ClientIp.Length > 0) { try { //test whether part or parts of clientIp match the filter condition. If we have no match, we need to skip logging. MatchCollection matches = Regex.Matches(p_ClientIp, BonCodeAJP13Settings.BONCODEAJP13_LOG_IPFILTER, RegexOptions.IgnorePatternWhitespace); if (matches.Count == 0) { initLogger = false; } } catch (Exception e) { //for any exception we will initialize logging anyway because of the initLogger flag errMsg = "Your regular expression provided in setting LogIPFilter raised exception:" + e.Message; } } if (initLogger) { //default log file name is BonCodeAJP13ConnectionLog.txt in directory of DLL or Windows p_Logger = new BonCodeAJP13Logger(BonCodeAJP13Settings.BONCODEAJP13_LOG_FILE + p_LogFilePostFix + DateTime.Now.ToString("yyyyMMdd") + ".log", p_ConnectionMutex); //if RegEx contained error message we will also write an error msg if (errMsg.Length > 0) { p_Logger.LogMessage(errMsg); } } } }
/// <summary> /// prep logging facilities /// </summary> private void CheckMutex() { if (BonCodeAJP13Settings.BONCODEAJP13_LOG_LEVEL > BonCodeAJP13LogLevels.BONCODEAJP13_NO_LOG) { p_Logger = new BonCodeAJP13Logger("BonCodeAJP13ConnectionLog.txt", p_ConnectionMutex); } }
public void LogExceptionTest() { string fileName = string.Empty; // TODO: Initialize to an appropriate value Mutex loggerMutex = null; // TODO: Initialize to an appropriate value BonCodeAJP13Logger target = new BonCodeAJP13Logger(fileName, loggerMutex); // TODO: Initialize to an appropriate value Exception e = null; // TODO: Initialize to an appropriate value string message = string.Empty; // TODO: Initialize to an appropriate value int onlyAboveLogLevel = 0; // TODO: Initialize to an appropriate value target.LogException(e, message, onlyAboveLogLevel); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public void LogPacketTest() { string fileName = string.Empty; // TODO: Initialize to an appropriate value Mutex loggerMutex = null; // TODO: Initialize to an appropriate value BonCodeAJP13Logger target = new BonCodeAJP13Logger(fileName, loggerMutex); // TODO: Initialize to an appropriate value BonCodeAJP13Packet packet = null; // TODO: Initialize to an appropriate value bool logAllways = false; // TODO: Initialize to an appropriate value int onlyAboveLogLevel = 0; // TODO: Initialize to an appropriate value target.LogPacket(packet, logAllways, onlyAboveLogLevel); Assert.Inconclusive("A method that does not return a value cannot be verified."); }