{"id":16807410,"url":"https://github.com/giginet/ccfluentdlogger","last_synced_at":"2025-10-25T20:06:13.844Z","repository":{"id":33361336,"uuid":"37006175","full_name":"giginet/CCFluentdLogger","owner":"giginet","description":"Log collector for cocos2d-x","archived":false,"fork":false,"pushed_at":"2015-06-07T13:53:23.000Z","size":92317,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T23:56:50.899Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giginet.png","metadata":{"files":{"readme":"README.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":"2015-06-07T05:50:29.000Z","updated_at":"2015-06-07T13:51:29.000Z","dependencies_parsed_at":"2022-09-11T23:00:53.875Z","dependency_job_id":null,"html_url":"https://github.com/giginet/CCFluentdLogger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giginet%2FCCFluentdLogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giginet%2FCCFluentdLogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giginet%2FCCFluentdLogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giginet%2FCCFluentdLogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giginet","download_url":"https://codeload.github.com/giginet/CCFluentdLogger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244003295,"owners_count":20382165,"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-13T09:53:45.244Z","updated_at":"2025-10-25T20:06:08.228Z","avatar_url":"https://github.com/giginet.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CCFluentdLogger\n\nThis is the cocos2d-x plugin to allow sending logs to fluentd easily.\n\n## Requirements\n\n- cocos2d-x 3.0+\n\n## Setup server\n\nYou must launch a fluentd endpoint on local or remote.\n\nYou can launch local fluentd server in the following way.\n\n### Setup\n\n```sh\n$ git clone https://github.com:giginet/CCFluentdLogger.git\n$ cd CCFluentdLogger/fluentd\n```\n\n### Launch\n\n```sh\n$ bundle install\n$ bundle exec foreman start\n```\n\nThen fluentd runs on `http://127.0.0.1:8888`\n\n## Implement log collecting logic in your Game\n\nImport all h/cpp files under `CCFluentdLogger/` into your project.\n\nAnd register configuration to the logger.\n\nTypically, you should implement the following logic on `AppDelegate::applicationDidFinishLaunching`.\n\n```cpp\n#include \"CCFluentdLogger.h\"\nusing namespace ccFluentdLogger;\n\nbool AppDelegate::applicationDidFinishLaunching() {\n    // Get shared logger instance\n    Logger * logger = Logger::getInstance();\n    \n    // Get default logger settings\n    Configuration config = Logger::getDefaultConfiguration();\n    config.host = \"http://127.0.0.1\";\n    config.port = 8888;\n\n    // Set configuration\n    logger-\u003esetConfiguration(config);\n}\n```\n\nImplement this snippets to post logs.\n\n```cpp\n#include \"CCFluentdLogger.h\"\nusing namespace ccFluentdLogger;\n\nvoid onButtonPressed()\n{\n    // Something to do\n\n    // Get shared logger instance\n    Logger * logger = Logger::getInstance();\n    \n    // Post log\n    logger-\u003epostLog(\"action\", json11::Json::object {{\"key\", \"value\"}});\n}\n```\n\nThese are all to do to post logs to the remote host.\n\n## Buffering\n\nOn above way, Logs are sent sequentially.\n\nThis plugin also allows to store logs and post them on specific timings like the game is end.\n\nTo buffer the logs, you should execute `Logger::postLog` with third-argument, execute `Logger::postBuffered` to send all buffered logs.\n\n\n```cpp\n#include \"CCFluentdLogger.h\"\nusing namespace ccFluentdLogger;\n\nvoid onButtonPressed()\n{\n    // Something to do\n\n    // Get shared logger instance\n    Logger * logger = Logger::getInstance();\n    \n    // Add log to buffer\n    // Third argument indicates whether to enable buffering or not\n    logger-\u003epostLog(\"action\", json11::Json::object {{\"key\", \"value\"}}, true);\n}\n\nvoid onGameOver()\n{\n    Logger * logger = Logger::getInstance();\n\n    // Post all buffered logs at one time.\n    logger-\u003epostBuffered();\n}\n```\n\nYou can set default `postLog` behavior with `Configuration.isBufferingEnabled`.\n\n## Run sample project\n\n1. Create a new project with `cocos` command.\n2. Copy `newProj/cocos2d` to `sample/cocos2d`\n3. open `CCFluentdLogger.xcodeproj`.\n\n## Author\n\ngiginet \u003cgiginet.net@gmail.com\u003e\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiginet%2Fccfluentdlogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiginet%2Fccfluentdlogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiginet%2Fccfluentdlogger/lists"}