{"id":16728851,"url":"https://github.com/coccoinomane/phpunit-log","last_synced_at":"2025-03-15T16:33:40.598Z","repository":{"id":65646920,"uuid":"596491731","full_name":"coccoinomane/phpunit-log","owner":"coccoinomane","description":"Log from within your PHPUnit tests","archived":false,"fork":false,"pushed_at":"2023-02-02T10:18:04.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T02:54:02.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coccoinomane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-02-02T09:51:50.000Z","updated_at":"2023-02-02T09:52:10.000Z","dependencies_parsed_at":"2023-02-17T18:16:16.056Z","dependency_job_id":null,"html_url":"https://github.com/coccoinomane/phpunit-log","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coccoinomane%2Fphpunit-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coccoinomane%2Fphpunit-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coccoinomane%2Fphpunit-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coccoinomane%2Fphpunit-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coccoinomane","download_url":"https://codeload.github.com/coccoinomane/phpunit-log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243760345,"owners_count":20343626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T23:12:08.179Z","updated_at":"2025-03-15T16:33:40.571Z","avatar_url":"https://github.com/coccoinomane.png","language":"PHP","readme":"Defines the `Loggable` trait to log from within your PHPUnit tests.\n\n# Usage\n\n1. Install the package with `composer require --dev coccoinomane/phpunit-log`.\n1. Include the trait in your TestCase with `\\use PHPUnitLog\\Loggable;`.\n1. Start logging with `this-\u003elog( $message )` or `this-\u003eprint( $message )`.\n\n# Features\n\n- To log a message to screen, call `self::print( $message )`.\n- To log a message to file, call `self::log( $message )`.\n- The file will be named after the test class and placed in the subfolder _tests/logs_.\n- Customize the log folder via the `logsPath` environment variable.\n- To delete the log files before each run:\n  ```php\n  public static function setUpBeforeClass(): void {\n    static::deleteLogFile();\n  }\n  ```\n- For further customizations, see the docs in [`Loggable`](./src/Loggable.php) or the tests in [`LoggableTest`](./tests/LoggableTest.php).\n\nThe `Loggable` trait is used by [`WordPressTestCase`](https://github.com/idearia/wp-tests).\n\n# Custom folder for the logs\n\nBy default, the log files will be placed in the _tests/logs_ folder; set the `logsPath` environment variable to use a different folder.\nYou can use both relative and absolute paths.\n\nTo set `logsPath` in _phpunit.xml_:\n\n```xml\n\u003cphp\u003e\n    \u003cenv name=\"logsPath\" value=\"./tests/logs\"/\u003e\n\u003c/php\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoccoinomane%2Fphpunit-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoccoinomane%2Fphpunit-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoccoinomane%2Fphpunit-log/lists"}