{"id":16305068,"url":"https://github.com/moznion/p5-test-fluent-logger","last_synced_at":"2025-04-10T23:55:13.867Z","repository":{"id":56838421,"uuid":"79936972","full_name":"moznion/p5-Test-Fluent-Logger","owner":"moznion","description":"A mock implementation of Fluent::Logger for testing","archived":false,"fork":false,"pushed_at":"2017-06-13T04:10:24.000Z","size":17,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T23:55:10.732Z","etag":null,"topics":["fluentd","perl","testing"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/Test::Fluent::Logger","language":"Perl","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/moznion.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","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":"2017-01-24T17:46:45.000Z","updated_at":"2017-01-29T10:36:50.000Z","dependencies_parsed_at":"2022-09-10T03:40:22.990Z","dependency_job_id":null,"html_url":"https://github.com/moznion/p5-Test-Fluent-Logger","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp5-Test-Fluent-Logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp5-Test-Fluent-Logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp5-Test-Fluent-Logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fp5-Test-Fluent-Logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moznion","download_url":"https://codeload.github.com/moznion/p5-Test-Fluent-Logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317701,"owners_count":21083528,"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":["fluentd","perl","testing"],"created_at":"2024-10-10T21:05:36.914Z","updated_at":"2025-04-10T23:55:13.851Z","avatar_url":"https://github.com/moznion.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/moznion/p5-Test-Fluent-Logger.svg?branch=master)](https://travis-ci.org/moznion/p5-Test-Fluent-Logger)\n# NAME\n\nTest::Fluent::Logger - A mock implementation of Fluent::Logger for testing\n\n# SYNOPSIS\n\n    use Test::More;\n    use Test::Fluent::Logger; # Enable the function of this library just by using\n                              # (Activate intercepting the fluentd log payload)\n\n    use Fluent::Logger;\n\n    my $logger = Fluent::Logger-\u003enew(\n        host       =\u003e '127.0.0.1',\n        port       =\u003e 24224,\n        tag_prefix =\u003e 'prefix',\n    );\n\n    $logger-\u003epost(\"tag1\", {foo =\u003e 'bar'}); # Don't post to fluentd, it puts the log content on internal stack\n    $logger-\u003epost(\"tag2\", {buz =\u003e 'qux'}); # ↑Either\n\n    # Get internal stack (array)\n    my @fluent_logs = get_fluent_logs;\n    is_deeply \\@fluent_logs, [\n        {\n            'tag_prefix' =\u003e 'prefix',\n            'time' =\u003e '1485443191.94598',\n            'message' =\u003e {\n                'foo' =\u003e 'bar'\n            }\n        },\n        {\n            'tag_prefix' =\u003e 'prefix',\n            'time' =\u003e '1485443191.94599',\n            'message' =\u003e {\n                'buz' =\u003e 'qux'\n            }\n        }\n    ];\n\n    # Clear internal stack (array)\n    clear_fluent_logs;\n\n    @fluent_logs = get_fluent_logs;\n    is_deeply \\@fluent_logs, [];\n\n# DESCRIPTION\n\nTest::Fluent::Logger is a mock implementation of Fluent::Logger for testing.\n\nThis library intercepts the log payload of fluentd and puts that on stack.\nYou can pickup log\\[s\\] from stack and it can be used to testing.\n\n# FUNCTIONS\n\n## `get_fluent_logs(): Array[HashRef]`\n\nGet fluentd logs from stack as array.\n\nItem of the array is hash reference. The hash reference is according to following format;\n\n    {\n        'tag_prefix' =\u003e 'prefix',\n        'time' =\u003e '1485443191.94599', # \u003c= timestamp\n        'message' =\u003e {\n            'buz' =\u003e 'qux'\n        }\n    }\n\n## `clear_fluent_logs()`\n\nClear stack of fluentd logs.\n\n## `activate()`\n\nActivate intercepting the log payload.\n\n## `deactivate()`\n\nDeactivate intercepting the log payload.\n\n# SEE ALSO\n\n- [Fluent::Logger](https://metacpan.org/pod/Fluent::Logger)\n\n# LICENSE\n\nCopyright (C) moznion.\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n\n# AUTHOR\n\nmoznion \u003cmoznion@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fp5-test-fluent-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoznion%2Fp5-test-fluent-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fp5-test-fluent-logger/lists"}