{"id":25257508,"url":"https://github.com/czproject/logger","last_synced_at":"2025-08-10T22:05:54.573Z","repository":{"id":56960996,"uuid":"70918683","full_name":"czproject/logger","owner":"czproject","description":"Output logger.","archived":false,"fork":false,"pushed_at":"2025-06-10T18:37:51.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-11T06:29:24.599Z","etag":null,"topics":["logger","logging","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/czproject.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":"https://www.janpecha.cz/donate/"}},"created_at":"2016-10-14T14:39:43.000Z","updated_at":"2025-06-10T18:36:17.000Z","dependencies_parsed_at":"2025-02-12T06:40:25.373Z","dependency_job_id":"385b0b2b-0acd-4a11-a68d-9f73e4a6f363","html_url":"https://github.com/czproject/logger","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/czproject/logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czproject%2Flogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czproject%2Flogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czproject%2Flogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czproject%2Flogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/czproject","download_url":"https://codeload.github.com/czproject/logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czproject%2Flogger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269794095,"owners_count":24476740,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"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":["logger","logging","php"],"created_at":"2025-02-12T06:40:14.836Z","updated_at":"2025-08-10T22:05:54.567Z","avatar_url":"https://github.com/czproject.png","language":"PHP","funding_links":["https://www.janpecha.cz/donate/"],"categories":[],"sub_categories":[],"readme":"# CzProject\\Logger\n\n[![Build Status](https://github.com/czproject/logger/workflows/Build/badge.svg)](https://github.com/czproject/logger/actions)\n[![Downloads this Month](https://img.shields.io/packagist/dm/czproject/logger.svg)](https://packagist.org/packages/czproject/logger)\n[![Latest Stable Version](https://poser.pugx.org/czproject/logger/v/stable)](https://github.com/czproject/logger/releases)\n[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/czproject/logger/blob/master/license.md)\n\n\u003ca href=\"https://www.janpecha.cz/donate/\"\u003e\u003cimg src=\"https://buymecoffee.intm.org/img/donate-banner.v1.svg\" alt=\"Donate\" height=\"100\"\u003e\u003c/a\u003e\n\n\n## Installation\n\n[Download a latest package](https://github.com/czproject/logger/releases) or use [Composer](http://getcomposer.org/):\n\n```\ncomposer require czproject/logger\n```\n\nCzProject\\Logger requires PHP 8.0 or later.\n\n\n## Usage\n\n``` php\nuse CzProject\\Logger;\nuse CzProject\\Logger\\ILogger;\n\n$logger = new Logger\\OutputLogger(ILogger::DEBUG); // minimal level\n$logger-\u003elog('Debug info', ILogger::DEBUG);\n$logger-\u003elog('Output', ILogger::INFO);\n$logger-\u003elog('Done!', ILogger::SUCCESS);\n$logger-\u003elog('Warning...', ILogger::WARNING);\n$logger-\u003elog('Error message', ILogger::ERROR);\n$logger-\u003elog('Exception message', ILogger::EXCEPTION);\n$logger-\u003elog('App crashed.', ILogger::CRITICAL);\n```\n\n### Loggers\n\n* `CzProject\\Logger\\CliLogger($level, $colored = NULL)` - sends messages to CLI STDOUT\n* `CzProject\\Logger\\OutputLogger($level)` - prints messages to STDOUT\n* `CzProject\\Logger\\FileLogger($path, $level)` - saves messages into new created file\n* `CzProject\\Logger\\MemoryLogger($level)` - saves messages into memory, you can use `$memoryLogger-\u003egetLog()`\n* `CzProject\\Logger\\MultiLogger()` - sends messages to other loggers\n\n``` php\n$logger = new Logger\\MultiLogger;\n$logger-\u003eaddLogger(new Logger\\OutputLogger(ILogger::INFO));\n$logger-\u003eaddLogger(new Logger\\FileLogger(__DIR__ . '/debug.log', ILogger::DEBUG));\n\n$logger-\u003elog($msg, $level);\n```\n\n### LoggerProxy\n\nLoggerProxy is interface for using of Logger.\n\n```php\n$logger = new Logger\\OutputLogger(ILogger::DEBUG); // minimal level\n$proxy = new Logger\\LoggerProxy($logger);\n$proxy-\u003edebug('Debug info');\n$proxy-\u003elog('Output'); // or $proxy-\u003einfo()\n$proxy-\u003esuccess('Done!');\n$proxy-\u003ewarning('Warning...', ILogger::WARNING);\n$proxy-\u003eerror('Error message', ILogger::ERROR);\n$proxy-\u003eexception('Exception message', ILogger::EXCEPTION);\n$proxy-\u003ecritical('App crashed.', ILogger::CRITICAL);\n```\n\n------------------------------\n\nLicense: [New BSD License](license.md)\n\u003cbr\u003eAuthor: Jan Pecha, https://www.janpecha.cz/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fczproject%2Flogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fczproject%2Flogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fczproject%2Flogger/lists"}