Quick.Logger.Intf.pas 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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 : 31/08/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. System.SysUtils;
  26. type
  27. ILogger = interface
  28. ['{1065BB46-7EB8-480A-8B30-ED3B865DDB18}']
  29. procedure Info(const aMsg : string); overload;
  30. procedure Info(const aMsg : string; aParams : array of const); overload;
  31. procedure Succ(const aMsg : string); overload;
  32. procedure Succ(const aMsg : string; aParams : array of const); overload;
  33. procedure Done(const aMsg : string); overload;
  34. procedure Done(const aMsg : string; aParams : array of const); overload;
  35. procedure Warn(const aMsg : string); overload;
  36. procedure Warn(const aMsg : string; aParams : array of const); overload;
  37. procedure Error(const aMsg : string); overload;
  38. procedure Error(const aMsg : string; aParams : array of const); overload;
  39. procedure Critical(const aMsg : string); overload;
  40. procedure Critical(const aMsg : string; aParams : array of const); overload;
  41. procedure Trace(const aMsg : string); overload;
  42. procedure Trace(const aMsg : string; aParams : array of const); overload;
  43. procedure Debug(const aMsg : string); overload;
  44. procedure Debug(const aMsg : string; aParams : array of const); overload;
  45. procedure &Except(const aMsg : string; aValues : array of const); overload;
  46. procedure &Except(const aMsg, aException, aStackTrace : string); overload;
  47. procedure &Except(const aMsg : string; aValues: array of const; const aException, aStackTrace: string); overload;
  48. end;
  49. TNullLogger = class(TInterfacedObject,ILogger)
  50. procedure Info(const aMsg : string); overload;
  51. procedure Info(const aMsg : string; aParams : array of const); overload;
  52. procedure Succ(const aMsg : string); overload;
  53. procedure Succ(const aMsg : string; aParams : array of const); overload;
  54. procedure Done(const aMsg : string); overload;
  55. procedure Done(const aMsg : string; aParams : array of const); overload;
  56. procedure Warn(const aMsg : string); overload;
  57. procedure Warn(const aMsg : string; aParams : array of const); overload;
  58. procedure Error(const aMsg : string); overload;
  59. procedure Error(const aMsg : string; aParams : array of const); overload;
  60. procedure Critical(const aMsg : string); overload;
  61. procedure Critical(const aMsg : string; aParams : array of const); overload;
  62. procedure Trace(const aMsg : string); overload;
  63. procedure Trace(const aMsg : string; aParams : array of const); overload;
  64. procedure Debug(const aMsg : string); overload;
  65. procedure Debug(const aMsg : string; aParams : array of const); overload;
  66. procedure &Except(const aMsg : string; aValues : array of const); overload;
  67. procedure &Except(const aMsg, aException, aStackTrace : string); overload;
  68. procedure &Except(const aMsg : string; aValues: array of const; const aException, aStackTrace: string); overload;
  69. end;
  70. implementation
  71. { TNullLogger }
  72. procedure TNullLogger.Info(const aMsg: string);
  73. begin
  74. end;
  75. procedure TNullLogger.Info(const aMsg: string; aParams: array of const);
  76. begin
  77. end;
  78. procedure TNullLogger.Succ(const aMsg: string; aParams: array of const);
  79. begin
  80. end;
  81. procedure TNullLogger.Succ(const aMsg: string);
  82. begin
  83. end;
  84. procedure TNullLogger.Done(const aMsg: string);
  85. begin
  86. end;
  87. procedure TNullLogger.Debug(const aMsg: string; aParams: array of const);
  88. begin
  89. end;
  90. procedure TNullLogger.Done(const aMsg: string; aParams: array of const);
  91. begin
  92. end;
  93. procedure TNullLogger.Warn(const aMsg: string);
  94. begin
  95. end;
  96. procedure TNullLogger.Warn(const aMsg: string; aParams: array of const);
  97. begin
  98. end;
  99. procedure TNullLogger.Error(const aMsg: string);
  100. begin
  101. end;
  102. procedure TNullLogger.Error(const aMsg: string; aParams: array of const);
  103. begin
  104. end;
  105. procedure TNullLogger.Critical(const aMsg: string);
  106. begin
  107. end;
  108. procedure TNullLogger.Critical(const aMsg: string; aParams: array of const);
  109. begin
  110. end;
  111. procedure TNullLogger.Trace(const aMsg: string);
  112. begin
  113. end;
  114. procedure TNullLogger.Trace(const aMsg: string; aParams: array of const);
  115. begin
  116. end;
  117. procedure TNullLogger.Debug(const aMsg: string);
  118. begin
  119. end;
  120. procedure TNullLogger.&Except(const aMsg: string; aValues: array of const);
  121. begin
  122. end;
  123. procedure TNullLogger.&Except(const aMsg: string; aValues: array of const; const aException, aStackTrace: string);
  124. begin
  125. end;
  126. procedure TNullLogger.&Except(const aMsg, aException, aStackTrace: string);
  127. begin
  128. end;
  129. end.