IErrorHandler.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. using System;
  20. namespace log4net.Core
  21. {
  22. /// <summary>
  23. /// Appenders may delegate their error handling to an <see cref="IErrorHandler" />.
  24. /// </summary>
  25. /// <remarks>
  26. /// <para>
  27. /// Error handling is a particularly tedious to get right because by
  28. /// definition errors are hard to predict and to reproduce.
  29. /// </para>
  30. /// </remarks>
  31. /// <author>Nicko Cadell</author>
  32. /// <author>Gert Driesen</author>
  33. public interface IErrorHandler
  34. {
  35. /// <summary>
  36. /// Handles the error and information about the error condition is passed as
  37. /// a parameter.
  38. /// </summary>
  39. /// <param name="message">The message associated with the error.</param>
  40. /// <param name="e">The <see cref="Exception" /> that was thrown when the error occurred.</param>
  41. /// <param name="errorCode">The error code associated with the error.</param>
  42. /// <remarks>
  43. /// <para>
  44. /// Handles the error and information about the error condition is passed as
  45. /// a parameter.
  46. /// </para>
  47. /// </remarks>
  48. void Error(string message, Exception e, ErrorCode errorCode);
  49. /// <summary>
  50. /// Prints the error message passed as a parameter.
  51. /// </summary>
  52. /// <param name="message">The message associated with the error.</param>
  53. /// <param name="e">The <see cref="Exception" /> that was thrown when the error occurred.</param>
  54. /// <remarks>
  55. /// <para>
  56. /// See <see cref="M:Error(string,Exception,ErrorCode)"/>.
  57. /// </para>
  58. /// </remarks>
  59. void Error(string message, Exception e);
  60. /// <summary>
  61. /// Prints the error message passed as a parameter.
  62. /// </summary>
  63. /// <param name="message">The message associated with the error.</param>
  64. /// <remarks>
  65. /// <para>
  66. /// See <see cref="M:Error(string,Exception,ErrorCode)"/>.
  67. /// </para>
  68. /// </remarks>
  69. void Error(string message);
  70. }
  71. }