예제 #1
0
        /// <summary>
        /// Remove the exist log recorder in the recorder list.
        /// Return false if the recorder not found.
        /// </summary>
        /// <param name="recorder">The recorder that you want to remove</param>
        /// <returns>A boolean value that represent if the recorder is removed</returns>
        public bool RemoveRecorder(LogRecorder recorder)
        {
            if (recorder == null) return false;

            return _recorders.Remove(recorder);
        }
예제 #2
0
        /// <summary>
        /// Add and regester a new log recorder into the recorder list.
        /// </summary>
        /// <param name="recorder">The new log recorder</param>
        public void AddRecorder(LogRecorder recorder)
        {
            if (recorder == null) return;

            _recorders.Add(recorder);
        }
예제 #3
0
파일: Log.cs 프로젝트: Masson/Tiny-Logger
 /// <summary>
 /// Set the recorder of the special level.
 /// </summary>
 /// <param name="level">The special log level</param>
 /// <param name="recoder">The recorder of the special level to set. 
 /// Set null if you want to remove the recorder.</param>
 public void SetRecorder(LogLevel level, LogRecorder recoder)
 {
     _recorders[(int)level] = recoder;
     _recorderSet.Add(recoder);
 }