Exemple #1
0
        public void AddTraceFile(string file, LogOptions_v1 options = LogOptions_v1.None)
        {
            if (_traceFiles.ContainsKey(file))
            {
                throw new PBException("error trace file already exist : \"{0}\"", file);
            }
            Log_v1 log = new Log_v1(file, options);

            _traceFiles.Add(file, log);
            //Writed += new WritedEvent(log.Write);
            _writeToTraceFiles += log.Write;
        }
Exemple #2
0
 public void SetLogFile(string file, LogOptions_v1 options)
 {
     if (file != null)
     {
         _log = new Log_v1(file, options);
     }
     else
     {
         _log = null;
     }
     //WriteLine("set log file to \"{0}\"", _log.File);
 }
Exemple #3
0
 public Log_v1(string file, LogOptions_v1 options = LogOptions_v1.None)
 {
     if ((options & LogOptions_v1.IndexedFile) == LogOptions_v1.IndexedFile)
     {
         _fileDefinition = file;
     }
     else if ((options & LogOptions_v1.LogToConsole) == LogOptions_v1.LogToConsole)
     {
         _logToConsole = true;
     }
     else
     {
         //if (!zPath.IsPathRooted(file))
         //    //file = zPath.Combine(Directory.GetCurrentDirectory(), file);
         //    file = zPath.Combine(zapp.GetAppDirectory(), file);
         //_file = file;
         _file = file.zRootPath(zapp.GetAppDirectory());
         if ((options & LogOptions_v1.RazLogFile) == LogOptions_v1.RazLogFile && zFile.Exists(file))
         {
             zFile.Delete(file);
         }
     }
 }
Exemple #4
0
 public void SetLogFile(string file, LogOptions_v1 options)
 {
     if (file != null)
         _log = new Log_v1(file, options);
     else
         _log = null;
     //WriteLine("set log file to \"{0}\"", _log.File);
 }
Exemple #5
0
 public Log_v1(string file, LogOptions_v1 options = LogOptions_v1.None)
 {
     if ((options & LogOptions_v1.IndexedFile) == LogOptions_v1.IndexedFile)
     {
         _fileDefinition = file;
     }
     else if ((options & LogOptions_v1.LogToConsole) == LogOptions_v1.LogToConsole)
     {
         _logToConsole = true;
     }
     else
     {
         //if (!zPath.IsPathRooted(file))
         //    //file = zPath.Combine(Directory.GetCurrentDirectory(), file);
         //    file = zPath.Combine(zapp.GetAppDirectory(), file);
         //_file = file;
         _file = file.zRootPath(zapp.GetAppDirectory());
         if ((options & LogOptions_v1.RazLogFile) == LogOptions_v1.RazLogFile && zFile.Exists(file))
             zFile.Delete(file);
     }
 }
Exemple #6
0
 public void AddTraceFile(string file, LogOptions_v1 options = LogOptions_v1.None)
 {
     if (_traceFiles.ContainsKey(file))
         throw new PBException("error trace file already exist : \"{0}\"", file);
     Log_v1 log = new Log_v1(file, options);
     _traceFiles.Add(file, log);
     //Writed += new WritedEvent(log.Write);
     _writeToTraceFiles += log.Write;
 }