source: branches/1.2/workflow/inc/log/tests/file.phpt @ 1349

Revision 1349, 626 bytes checked in by niltonneto, 15 years ago (diff)

Ticket #561 - Inclusão do módulo Workflow faltante nessa versão.

  • Property svn:executable set to *
Line 
1--TEST--
2Log: File Handler
3--FILE--
4<?php
5
6require_once 'Log.php';
7
8$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'test.log';
9if (file_exists($filename)) unlink($filename);
10
11/* Write some entries to the log file. */
12$conf = array('lineFormat' => '%2$s [%3$s] %4$s');
13$logger = &Log::singleton('file', $filename, '', $conf);
14
15for ($i = 0; $i < 3; $i++) {
16        $logger->log("Log entry $i");
17}
18$logger->close();
19
20/* Dump the contents of the log file. */
21echo file_get_contents($filename);
22
23/* Clean up. */
24if (file_exists($filename)) unlink($filename);
25
26--EXPECT--
27 [info] Log entry 0
28 [info] Log entry 1
29 [info] Log entry 2
Note: See TracBrowser for help on using the repository browser.