internal void Initialize(Logger logger, NoticeCompletePutDelegate noticeCompletePut) { if (noticeCompletePut == null || logger.CompletePutNoticeType == CompletePutNoticeType.None) { throw new LoggerException($"Fail {nameof(CompletePutNotifier)}::{nameof(Initialize)}"); } _config = logger.Config; _errorCounter = logger.ErrorCounter; _completePutNoticeType = logger.CompletePutNoticeType; _noticeCompletePut = noticeCompletePut; }
internal Logger(Config config, NoticeCompletePutDelegate noticeCompletePut, CompletePutNoticeType completePutNoticeType) { Config = config ?? throw new NoNullAllowedException(nameof(config)); if (completePutNoticeType != CompletePutNoticeType.None) { if (noticeCompletePut == null) { throw new NoNullAllowedException(nameof(CompletePutDelegate)); } } CompletePutDelegate = noticeCompletePut; CompletePutNoticeType = completePutNoticeType; }
/// <summary> /// <see cref="Config"/> 부터 로거를 생성한다. /// </summary> /// <param name="config"> /// <see cref="Config.Create"/> 로 생성한 인스턴스. /// </param> /// <param name="noticeCompletePut"> /// 처리 완료한 로그에 대한 콜백(<see cref="NoticeCompletePutDelegate"/>). /// </param> /// <param name="completePutNoticeType"> /// 통지받을 결과 종류. /// </param> public KLoggerAPI(Config config, NoticeCompletePutDelegate noticeCompletePut, CompletePutNoticeType completePutNoticeType = CompletePutNoticeType.FailOnly) { _logger = new Logger(config, noticeCompletePut, completePutNoticeType); }
internal Logger(String configPath, NoticeCompletePutDelegate noticeCompletePut, CompletePutNoticeType completePutNoticeType) : this(Config.Create(configPath), noticeCompletePut, completePutNoticeType) { }