Quick.Logger.Intf.pas 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. { ***************************************************************************
  2. Copyright (c) 2016-2019 Kike Pérez
  3. Unit : Quick.Logger.Intf
  4. Description : Quick Logger Interface
  5. Author : Kike Pérez
  6. Version : 1.8
  7. Created : 30/08/2019
  8. Modified : 11/09/2019
  9. This file is part of QuickLib: https://github.com/exilon/QuickLib
  10. ***************************************************************************
  11. Licensed under the Apache License, Version 2.0 (the "License");
  12. you may not use this file except in compliance with the License.
  13. You may obtain a copy of the License at
  14. http://www.apache.org/licenses/LICENSE-2.0
  15. Unless required by applicable law or agreed to in writing, software
  16. distributed under the License is distributed on an "AS IS" BASIS,
  17. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18. See the License for the specific language governing permissions and
  19. limitations under the License.
  20. *************************************************************************** }
  21. unit Quick.Logger.Intf;
  22. {$i QuickLib.inc}
  23. interface
  24. uses
  25. {$IFNDEF FPC}
  26. System.SysUtils;
  27. {$ELSE}
  28. SysUtils;
  29. {$ENDIF}
  30. type
  31. ILogger = interface
  32. ['{1065BB46-7EB8-480A-8B30-ED3B865DDB18}']
  33. procedure Info(const aMsg : string); overload;
  34. procedure Info(const aMsg : string; aParams : array of const); overload;
  35. procedure Succ(const aMsg : string); overload;
  36. procedure Succ(const aMsg : string; aParams : array of const); overload;
  37. procedure Done(const aMsg : string); overload;
  38. procedure Done(const aMsg : string; aParams : array of const); overload;
  39. procedure Warn(const aMsg : string); overload;
  40. procedure Warn(const aMsg : string; aParams : array of const); overload;
  41. procedure Error(const aMsg : string); overload;
  42. procedure Error(const aMsg : string; aParams : array of const); overload;
  43. procedure Critical(const aMsg : string); overload;
  44. procedure Critical(const aMsg : string; aParams : array of const); overload;
  45. procedure Trace(const aMsg : string); overload;
  46. procedure Trace(const aMsg : string; aParams : array of const); overload;
  47. procedure Debug(const aMsg : string); overload;
  48. procedure Debug(const aMsg : string; aParams : array of const); overload;
  49. procedure &Except(const aMsg : string; aValues : array of const); overload;
  50. procedure &Except(const aMsg, aException, aStackTrace : string); overload;
  51. procedure &Except(const aMsg : string; aValues: array of const; const aException, aStackTrace: string); overload;
  52. end;
  53. TNullLogger = class(TInterfacedObject,ILogger)
  54. procedure Info(const aMsg : string); overload;
  55. procedure Info(const aMsg : string; aParams : array of const); overload;
  56. procedure Succ(const aMsg : string); overload;
  57. procedure Succ(const aMsg : string; aParams : array of const); overload;
  58. procedure Done(const aMsg : string); overload;
  59. procedure Done(const aMsg : string; aParams : array of const); overload;
  60. procedure Warn(const aMsg : string); overload;
  61. procedure Warn(const aMsg : string; aParams : array of const); overload;
  62. procedure Error(const aMsg : string); overload;
  63. procedure Error(const aMsg : string; aParams : array of const); overload;
  64. procedure Critical(const aMsg : string); overload;
  65. procedure Critical(const aMsg : string; aParams : array of const); overload;
  66. procedure Trace(const aMsg : string); overload;
  67. procedure Trace(const aMsg : string; aParams : array of const); overload;
  68. procedure Debug(const aMsg : string); overload;
  69. procedure Debug(const aMsg : string; aParams : array of const); overload;
  70. procedure &Except(const aMsg : string; aValues : array of const); overload;
  71. procedure &Except(const aMsg, aException, aStackTrace : string); overload;
  72. procedure &Except(const aMsg : string; aValues: array of const; const aException, aStackTrace: string); overload;
  73. end;
  74. implementation
  75. { TNullLogger }
  76. procedure TNullLogger.Info(const aMsg: string);
  77. begin
  78. end;
  79. procedure TNullLogger.Info(const aMsg: string; aParams: array of const);
  80. begin
  81. end;
  82. procedure TNullLogger.Succ(const aMsg: string; aParams: array of const);
  83. begin
  84. end;
  85. procedure TNullLogger.Succ(const aMsg: string);
  86. begin
  87. end;
  88. procedure TNullLogger.Done(const aMsg: string);
  89. begin
  90. end;
  91. procedure TNullLogger.Debug(const aMsg: string; aParams: array of const);
  92. begin
  93. end;
  94. procedure TNullLogger.Done(const aMsg: string; aParams: array of const);
  95. begin
  96. end;
  97. procedure TNullLogger.Warn(const aMsg: string);
  98. begin
  99. end;
  100. procedure TNullLogger.Warn(const aMsg: string; aParams: array of const);
  101. begin
  102. end;
  103. procedure TNullLogger.Error(const aMsg: string);
  104. begin
  105. end;
  106. procedure TNullLogger.Error(const aMsg: string; aParams: array of const);
  107. begin
  108. end;
  109. procedure TNullLogger.Critical(const aMsg: string);
  110. begin
  111. end;
  112. procedure TNullLogger.Critical(const aMsg: string; aParams: array of const);
  113. begin
  114. end;
  115. procedure TNullLogger.Trace(const aMsg: string);
  116. begin
  117. end;
  118. procedure TNullLogger.Trace(const aMsg: string; aParams: array of const);
  119. begin
  120. end;
  121. procedure TNullLogger.Debug(const aMsg: string);
  122. begin
  123. end;
  124. procedure TNullLogger.&Except(const aMsg: string; aValues: array of const);
  125. begin
  126. end;
  127. procedure TNullLogger.&Except(const aMsg: string; aValues: array of const; const aException, aStackTrace: string);
  128. begin
  129. end;
  130. procedure TNullLogger.&Except(const aMsg, aException, aStackTrace: string);
  131. begin
  132. end;
  133. end.