ILoggerFactory.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.Repository.Hierarchy
  20. {
  21. /// <summary>
  22. /// Interface abstracts creation of <see cref="Logger"/> instances
  23. /// </summary>
  24. /// <remarks>
  25. /// <para>
  26. /// This interface is used by the <see cref="Hierarchy"/> to
  27. /// create new <see cref="Logger"/> objects.
  28. /// </para>
  29. /// <para>
  30. /// The <see cref="CreateLogger"/> method is called
  31. /// to create a named <see cref="Logger" />.
  32. /// </para>
  33. /// <para>
  34. /// Implement this interface to create new subclasses of <see cref="Logger" />.
  35. /// </para>
  36. /// </remarks>
  37. /// <author>Nicko Cadell</author>
  38. /// <author>Gert Driesen</author>
  39. public interface ILoggerFactory
  40. {
  41. /// <summary>
  42. /// Create a new <see cref="Logger" /> instance
  43. /// </summary>
  44. /// <param name="repository">The <see cref="ILoggerRepository" /> that will own the <see cref="Logger" />.</param>
  45. /// <param name="name">The name of the <see cref="Logger" />.</param>
  46. /// <returns>The <see cref="Logger" /> instance for the specified name.</returns>
  47. /// <remarks>
  48. /// <para>
  49. /// Create a new <see cref="Logger" /> instance with the
  50. /// specified name.
  51. /// </para>
  52. /// <para>
  53. /// Called by the <see cref="Hierarchy"/> to create
  54. /// new named <see cref="Logger"/> instances.
  55. /// </para>
  56. /// <para>
  57. /// If the <paramref name="name"/> is <c>null</c> then the root logger
  58. /// must be returned.
  59. /// </para>
  60. /// </remarks>
  61. Logger CreateLogger(ILoggerRepository repository, string name);
  62. }
  63. }