MAKS\AmqpAgent\Helper\Logger::log
Logs a message to a file, generates it if it does not exist and raises a user-level warning and/or notice on misuse.
Signature
public function log(string
$message,
[string
$filename = NULL,
[string
$directory = NULL]] )
Parameters
$message
—
string
- The message wished to be logged.
$filename
—
string
- [optional] The name wished to be given to the file. If not provided a Notice will be raised with the auto-generated filename.
$directory
—
string
- [optional] The directory where the log file should be written. If not provided a Warning will be raised with the used path.
Returns
- bool
- True if message was written.
Test Coverage
Information
- Coverage: 29/29 Lines (100%)
- Tests: 3
- Passed: 3 (100%)
Tests
- [ PASSED ] — MAKS\AmqpAgent\Tests\Helper\LoggerTest::testGeneratingALogFileIfItDoesNotExistAndWritingToIt
- [ PASSED ] — MAKS\AmqpAgent\Tests\Helper\LoggerTest::testStaticCallingAndInsufficientCalling
- [ PASSED ] — MAKS\AmqpAgent\Tests\Helper\LoggerTest::testGettersAndSetters