TDBLogInserterUnit.pas 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {
  2. Copyright 2005-2006 Log4Delphi Project
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. }
  13. {*----------------------------------------------------------------------------
  14. Contains the TDBLogInserter class.
  15. @version 0.5
  16. @author <a href="mailto:Bartosz.Tomasik@gmail.com">Bartosz Tomasik</a>
  17. @author <a href="mailto:tcmiller@users.sourceforge.net">Trevor Miller</a>
  18. ----------------------------------------------------------------------------}
  19. unit TDBLogInserterUnit;
  20. {$ifdef fpc}
  21. {$mode objfpc}
  22. {$h+}
  23. {$endif}
  24. interface
  25. uses
  26. TLoggingEventUnit;
  27. type
  28. {*----------------------------------------------------------------------------
  29. Database abstraction - implement this abstract class with
  30. support for specific databases for outputting log statements.
  31. ----------------------------------------------------------------------------}
  32. TDbLogInserter = class (TObject)
  33. protected
  34. procedure Insert(AEvent : TLoggingEvent); virtual; abstract;
  35. public
  36. procedure DoInsert(AEvent : TLoggingEvent);
  37. end;
  38. implementation
  39. procedure TDbLogInserter.DoInsert(AEvent : TLoggingEvent);
  40. begin
  41. Self.Insert(AEvent);
  42. end;
  43. end.