Пример #1
0
        public TextLoggerProvider(TextLoggerOption options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (string.IsNullOrWhiteSpace(options.LoggerPath))
            {
                throw new ArgumentNullException(nameof(options), Resource.ResourceManager.GetString("ERROR_PATH_NOT_FOUND"));
            }

            _options = options;
        }
Пример #2
0
        public TextLogger(TextLoggerOption options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (string.IsNullOrWhiteSpace(options.LoggerPath))
            {
                throw new ArgumentNullException(nameof(options), Resource.ResourceManager.GetString("ERROR_PATH_NOT_FOUND"));
            }

            _options = options;
            if (!Directory.Exists(options.LoggerPath))
            {
                Directory.CreateDirectory(options.LoggerPath);
            }
        }