/// <summary> /// Constructor /// </summary> /// <param name="fileName">Path and file name of log</param> /// <param name="debInf">Debug informations includng level, verbose, rotation information</param> public Debug(String fileName, ref DebugInformations debInf) { if (fileName.CompareTo("") == 0) { fileName = this._FileName; } Regex re = new Regex(@"\w+:\\\w+", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled); if (re.IsMatch(fileName)) { this._Path = fileName.Substring(0, fileName.LastIndexOf('\\')); if (System.IO.Directory.Exists(this._Path)) { this._FileName = fileName; } else { String exepath = Environment.GetCommandLineArgs()[0]; this._Path = exepath.Substring(0, exepath.LastIndexOf('\\')); this._FileName = this._Path + "\\" + fileName; } } else { String exepath = Environment.GetCommandLineArgs()[0]; this._Path = exepath.Substring(0, exepath.LastIndexOf('\\')); this._FileName = this._Path + "\\" + fileName; } this._DebugInfo = debInf; this._DebugInfo.Level = 1; }