コード例 #1
0
 internal LogScope(string name, ILogProvider provider, Action <RuleLevel> dispose)
 {
     _name        = name;
     _dispose     = dispose;
     _logProvider = provider;
     _log         = _logProvider.Get(name);
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LogScope"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="logProvider">The log provider.</param>
 public LogScope(string name, ILogProvider logProvider)
 {
     _name        = name;
     _logProvider = logProvider;
     _dispose     = level => { };
     _log         = _logProvider.Get(name);
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LogScope"/> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="logProvider">The log provider.</param>
 public LogScope(string name, ILogProvider logProvider)
 {
     _name = name;
     _logProvider = logProvider;
     _dispose = level => { };
     _log = _logProvider.Get(name);
 }
コード例 #4
0
 internal LogScope(string name, ILogProvider provider, Action<RuleLevel> dispose)
 {
     _name = name;
     _dispose = dispose;
     _logProvider = provider;
     _log = _logProvider.Get(name);
 }
コード例 #5
0
		/// <summary>
		/// Authentication filter for Brightspace OAuth 2.0
		/// </summary>
		/// <param name="logProvider"></param>
		/// <param name="requestAuthenticator"></param>
		/// <param name="principalDependencyRegistry">Called to do out-of-band actions like set up ID2LPrincipal for dependency injection.</param>
		public OAuth2AuthenticationFilter(
			ILogProvider logProvider,
			IRequestAuthenticator requestAuthenticator,
			ID2LPrincipalDependencyRegistry principalDependencyRegistry
		) {
			m_log = logProvider.Get( this.GetType() );
			m_requestAuthenticator = requestAuthenticator;
			m_principalDependencyRegistry = principalDependencyRegistry;
		}
コード例 #6
0
 /// <summary>
 /// Authentication filter for Brightspace OAuth 2.0
 /// </summary>
 /// <param name="logProvider"></param>
 /// <param name="requestAuthenticator"></param>
 /// <param name="principalDependencyRegistry">Called to do out-of-band actions like set up ID2LPrincipal for dependency injection.</param>
 public OAuth2AuthenticationFilter(
     ILogProvider logProvider,
     IRequestAuthenticator requestAuthenticator,
     ID2LPrincipalDependencyRegistry principalDependencyRegistry
     )
 {
     m_log = logProvider.Get(this.GetType());
     m_requestAuthenticator        = requestAuthenticator;
     m_principalDependencyRegistry = principalDependencyRegistry;
 }
コード例 #7
0
 /// <summary>
 /// Creates new log with using <see cref="Type.Namespace"/> for the name.
 /// </summary>
 /// <param name="logProvider">The log provider.</param>
 /// <param name="instance">The instance to retrieve type for naming from.</param>
 /// <returns>new instance of the log</returns>
 public static ILog LogForNamespace(this ILogProvider logProvider, object instance)
 {
     return(logProvider.Get(instance.GetType().Namespace));
 }
コード例 #8
0
 /// <summary>
 /// Creates new log with using <see cref="Type.Namespace"/> for the name.
 /// </summary>
 /// <typeparam name="T">type to use for naming</typeparam>
 /// <param name="logProvider">The log provider.</param>
 /// <returns>new instance of the log</returns>
 public static ILog LogForNamespace <T>(this ILogProvider logProvider)
 {
     return(logProvider.Get(typeof(T).Namespace));
 }
コード例 #9
0
 /// <summary>
 /// Creates new log with using <see cref="Type.FullName"/> for the name.
 /// </summary>
 /// <typeparam name="T">type to use for naming</typeparam>
 /// <param name="logProvider">The log provider.</param>
 /// <returns>new instance of the log</returns>
 public static ILog LogForType <T>(this ILogProvider logProvider)
 {
     return(logProvider.Get(typeof(T).FullName));
 }
コード例 #10
0
ファイル: Service.cs プロジェクト: ib2018/net-party
 public Service(ILogProvider logProvider, IApiService apiService, IRepository repository)
 {
     _log        = logProvider.Get <Service>(nameof(Service));
     _apiService = apiService;
     _repository = repository;
 }