LoggerInterface.php 936 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\DB;
  7. /**
  8. * DB logger interface
  9. */
  10. interface LoggerInterface
  11. {
  12. /**#@+
  13. * Types of connections to be logged
  14. */
  15. const TYPE_CONNECT = 'connect';
  16. const TYPE_TRANSACTION = 'transaction';
  17. const TYPE_QUERY = 'query';
  18. /**#@-*/
  19. /**
  20. * Adds log record
  21. *
  22. * @param string $str
  23. * @return void
  24. */
  25. public function log($str);
  26. /**
  27. * @return void
  28. */
  29. public function startTimer();
  30. /**
  31. * @param string $type
  32. * @param string $sql
  33. * @param array $bind
  34. * @param \Zend_Db_Statement_Pdo|null $result
  35. * @return void
  36. */
  37. public function logStats($type, $sql, $bind = [], $result = null);
  38. /**
  39. * @param \Exception $e
  40. * @return void
  41. */
  42. public function critical(\Exception $e);
  43. }