コード例 #1
0
ファイル: LogFactory.cs プロジェクト: SobhanAp/Lykke.Logs
        /// <inheritdoc />
        public ILog CreateLog <TComponent>(TComponent component)
        {
            if (component == null)
            {
                throw new ArgumentNullException(nameof(component));
            }

            ILog log = new Log(_loggerFactory.CreateLogger(ComponentNameHelper.GetComponentName(component)), _healthNotifierProvider.Invoke());

            return(_sanitizingOptions.Filters.Any()
                ? new SanitizingLog(log, _sanitizingOptions)
                : log);
        }
コード例 #2
0
ファイル: LogFactory.cs プロジェクト: SobhanAp/Lykke.Logs
        /// <inheritdoc />
        public ILog CreateLog <TComponent>(TComponent component, string componentNameSuffix)
        {
            if (component == null)
            {
                throw new ArgumentNullException(nameof(component));
            }
            if (string.IsNullOrWhiteSpace(componentNameSuffix))
            {
                throw new ArgumentException("Should be not empty string", nameof(componentNameSuffix));
            }

            ILog log = new Log(_loggerFactory.CreateLogger(ComponentNameHelper.GetComponentName(component, componentNameSuffix)), _healthNotifierProvider.Invoke());

            return(_sanitizingOptions.Filters.Any()
                ? new SanitizingLog(log, _sanitizingOptions)
                : log);
        }