LoggerWrapperImpl.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #region Apache License
  2. //
  3. // Licensed to the Apache Software Foundation (ASF) under one or more
  4. // contributor license agreements. See the NOTICE file distributed with
  5. // this work for additional information regarding copyright ownership.
  6. // The ASF licenses this file to you under the Apache License, Version 2.0
  7. // (the "License"); you may not use this file except in compliance with
  8. // the License. You may obtain a copy of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS,
  14. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. // See the License for the specific language governing permissions and
  16. // limitations under the License.
  17. //
  18. #endregion
  19. namespace log4net.Core
  20. {
  21. /// <summary>
  22. /// Implementation of the <see cref="ILoggerWrapper"/> interface.
  23. /// </summary>
  24. /// <remarks>
  25. /// <para>
  26. /// This class should be used as the base for all wrapper implementations.
  27. /// </para>
  28. /// </remarks>
  29. /// <author>Nicko Cadell</author>
  30. /// <author>Gert Driesen</author>
  31. public abstract class LoggerWrapperImpl : ILoggerWrapper
  32. {
  33. #region Protected Instance Constructors
  34. /// <summary>
  35. /// Constructs a new wrapper for the specified logger.
  36. /// </summary>
  37. /// <param name="logger">The logger to wrap.</param>
  38. /// <remarks>
  39. /// <para>
  40. /// Constructs a new wrapper for the specified logger.
  41. /// </para>
  42. /// </remarks>
  43. protected LoggerWrapperImpl(ILogger logger)
  44. {
  45. m_logger = logger;
  46. }
  47. #endregion Public Instance Constructors
  48. #region Implementation of ILoggerWrapper
  49. /// <summary>
  50. /// Gets the implementation behind this wrapper object.
  51. /// </summary>
  52. /// <value>
  53. /// The <see cref="ILogger"/> object that this object is implementing.
  54. /// </value>
  55. /// <remarks>
  56. /// <para>
  57. /// The <c>Logger</c> object may not be the same object as this object
  58. /// because of logger decorators.
  59. /// </para>
  60. /// <para>
  61. /// This gets the actual underlying objects that is used to process
  62. /// the log events.
  63. /// </para>
  64. /// </remarks>
  65. virtual public ILogger Logger
  66. {
  67. get { return m_logger; }
  68. }
  69. #endregion
  70. #region Private Instance Fields
  71. /// <summary>
  72. /// The logger that this object is wrapping
  73. /// </summary>
  74. private readonly ILogger m_logger;
  75. #endregion Private Instance Fields
  76. }
  77. }