Skip to content

Commit

Permalink
Improved class comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Guido W. Pettinari committed Jun 15, 2022
1 parent f5771c2 commit 04884c7
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/Loggable.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@
* Simple logger for PHPUnit tests.
*
* Features:
*
* - Use self::log( $message ) to log a message to file. The file will
* be named after the test class and be placed in the logs subfolder.
* - Choose a custom subfolder for the log files via the environment
* variable 'logsPath', or customize the full path overriding getLogFilePath().
* - Choose a different output stream by ovverriding getLogStream().
* be named after the test class, and be placed in the logs subfolder.
*
* - Choose a custom subfolder for the log files via the environment variable
* 'logsPath'.
*
* - You can change the full path of the log file (including its name and
* extension) by overriding the static method getLogFilePath().
*
* - For even more control, directly plug-in an output stream by overriding
* the static method getLogStream().
*
* - To clean the log file before each run, simply delete it in the
* constructor: unlink( self::getLogFilePath() );
*/
trait Loggable
{
Expand Down Expand Up @@ -61,7 +71,7 @@ protected static function getLogStream()
*/
protected static function maybeCreateDir(): bool
{
$dir = dirname( self::getLogFilePath() );
$dir = dirname( static::getLogFilePath() );

if ( ! file_exists( $dir ) ) {
return mkdir( $dir, 0744, true );
Expand Down

0 comments on commit 04884c7

Please sign in to comment.