StdOut.php 612 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * STDOUT log writer. Writes out messages to STDOUT.
  4. *
  5. * @package KO7
  6. * @category Logging
  7. *
  8. * @copyright (c) 2007-2016 Kohana Team
  9. * @copyright (c) since 2016 Koseven Team
  10. * @license https://koseven.dev/LICENSE
  11. */
  12. class KO7_Log_StdOut extends Log_Writer {
  13. /**
  14. * Writes each of the messages to STDOUT.
  15. *
  16. * $writer->write($messages);
  17. *
  18. * @param array $messages
  19. * @return void
  20. */
  21. public function write(array $messages)
  22. {
  23. foreach ($messages as $message)
  24. {
  25. // Writes out each message
  26. fwrite(STDOUT, $this->format_message($message).PHP_EOL);
  27. }
  28. }
  29. }