{"id":15025560,"url":"https://github.com/parseword/pickset","last_synced_at":"2026-02-28T04:44:28.777Z","repository":{"id":57036002,"uuid":"168881786","full_name":"parseword/pickset","owner":"parseword","description":"A collection of PHP utilities to quickly \"unlock\" various capabilities in any application","archived":false,"fork":false,"pushed_at":"2022-12-15T21:34:40.000Z","size":25,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-05T22:49:20.113Z","etag":null,"topics":["database","date-formatting","logger","php","php7","php71","singleton","text-processing"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parseword.png","metadata":{"files":{"readme":"README-Logger.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-02T21:46:38.000Z","updated_at":"2023-01-14T18:13:33.000Z","dependencies_parsed_at":"2023-01-29T04:25:11.945Z","dependency_job_id":null,"html_url":"https://github.com/parseword/pickset","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/parseword/pickset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Fpickset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Fpickset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Fpickset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Fpickset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parseword","download_url":"https://codeload.github.com/parseword/pickset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parseword%2Fpickset/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29924825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["database","date-formatting","logger","php","php7","php71","singleton","text-processing"],"created_at":"2024-09-24T20:02:34.390Z","updated_at":"2026-02-28T04:44:28.757Z","avatar_url":"https://github.com/parseword.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Logger\r\n\r\nLogger is a PHP text file logging facility, implemented as a singleton class.\r\n\r\n## Usage\r\n\r\nImplementing `Logger` in 4 easy steps:\r\n\r\n1. Either `composer require parseword/pickset` or copy the `Logger.php` file \r\ninto your project.\r\n\r\n2. Make sure `Logger.php` is discoverable by your autoloader, or `require_once` \r\nit manually.\r\n\r\n3. Throughout your application code, call `Logger::debug()`, `Logger::info()`, \r\n`Logger::warning()` and `Logger::error()` to send log messages of differing \r\nseverity levels.\r\n\r\n4. In your application's config file or a common include file, you (or the user) \r\ncall `Logger::setFilename()` to set the log file, and `Logger::setSeverityFilter()` \r\nto specify which log messages are written to disk.\r\n\r\n## Example\r\n\r\nIn the following example, a file named `/tmp/my.log` is created. The severity \r\nfilter is set so that only messages with severity of WARNING or higher will be \r\nwritten. Messages with lower severity will be disregarded.\r\n\r\n```php\r\n\u003c?php\r\n//Set up the logger in your config or global include file\r\nuse parseword\\pickset\\Logger;\r\nLogger::setFilename('/tmp/my.log');\r\nLogger::setSeverityFilter(Logger::SEVERITY_WARNING);\r\nLogger::setLabel('myCoolApp');\r\n\r\n//Call the static Logger methods throughout your application code\r\nLogger::info(\"Somebody set us up the bomb.\");\r\nLogger::debug(\"Main screen turn on.\");\r\nLogger::warning(\"All your base are belong to us.\");\r\nLogger::info(\"You have no chance to survive make your time.\");\r\nLogger::error(\"Unable to move 'ZIG', aborting\");\r\n```\r\n\r\nThe contents of `/tmp/my.log` will look like this:\r\n\r\n```\r\n[2019-01-25,14:40:13.797 CST]  WARN: myCoolApp: All your base are belong to us.\r\n[2019-01-25,14:40:13.797 CST] ERROR: myCoolApp: Unable to move 'ZIG', aborting\r\n```\r\n\r\nInspect or run the included `test.php` file for more examples.\r\n\r\n## Method overview\r\n\r\nThese methods are used to configure the Logger:\r\n\r\n* `setCollapseEntries()` - Whether or not to replace newlines in log entries \r\nwith spaces, constraining each entry to a single line. Defaults to true.\r\n\r\n* `setDateFormat()` - Set the date format to use when stamping log messages.\r\n\r\n* `setFilename()` - Set the filesystem path and filename for the log file.\r\n\r\n* `setLabel()` - Set an optional text string to include in log messages. If \r\neach instance of your application has a unique ID, setting it here can help \r\nwith tracing and troubleshooting.\r\n\r\n* `setSeverityFilter()` - Set which types of log messages are written to the file.\r\n\r\nThese methods control the logger's functionality:\r\n\r\n* `debug()` - Send a log message of severity DEBUG.\r\n\r\n* `error()` - Send a log message of severity ERROR.\r\n\r\n* `warning()` - Send a log message of severity WARNING.\r\n\r\n* `info()` - Send a log message of severity INFO.\r\n\r\n* `truncate()` - Truncate the log file, wiping out any previous entries.\r\n\r\n## Requirements\r\n\r\nThe Logger class requires PHP7 to support scalar type declarations.\r\n\r\n## Errata\r\n\r\nNone at this time.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparseword%2Fpickset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparseword%2Fpickset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparseword%2Fpickset/lists"}