예제 #1
0
        //-------------------------------------------//

        /// <summary>
        /// Try remove a local file.
        /// </summary>
        protected static void TryRemoveFile(string path, int count)
        {
            try {
                File.Delete(path);
                return;
            } catch (Exception ex) {
                Log.Debug("Couldn't delete file. " + ex);
            }

            if (--count == 0)
            {
                Log.Error("Couldn't remove file '" + path + "'.");
                return;
            }

            _toRemove.Add(path, count);
            new Timer(2000, ActionSet.New(_removeSequence.AddRun, _toRemove));
        }
예제 #2
0
 /// <summary>
 /// On a new log event.
 /// </summary>
 protected static void OnLog(ILogEvent log)
 {
     _roll.Add(log);
     _sequence.AddRun(_roll);
 }