{"id":19854975,"url":"https://github.com/monhi/cpplogger","last_synced_at":"2026-05-14T00:31:56.979Z","repository":{"id":154692064,"uuid":"557283167","full_name":"monhi/cpplogger","owner":"monhi","description":"Native C++ circular logger package (N-API)  for node.js projects ","archived":false,"fork":false,"pushed_at":"2024-01-02T15:01:32.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T13:52:08.127Z","etag":null,"topics":["circular","cpp","logger","n-api","nodejs","plog"],"latest_commit_sha":null,"homepage":"","language":"C++","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/monhi.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-10-25T12:08:23.000Z","updated_at":"2022-10-26T05:02:09.000Z","dependencies_parsed_at":"2023-11-03T15:45:11.833Z","dependency_job_id":null,"html_url":"https://github.com/monhi/cpplogger","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/monhi%2Fcpplogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monhi%2Fcpplogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monhi%2Fcpplogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monhi%2Fcpplogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monhi","download_url":"https://codeload.github.com/monhi/cpplogger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241245193,"owners_count":19933295,"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":["circular","cpp","logger","n-api","nodejs","plog"],"created_at":"2024-11-12T14:11:16.573Z","updated_at":"2026-05-14T00:31:51.948Z","avatar_url":"https://github.com/monhi.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cpplogger\nThis is a native Node.js package that can be used for logging purposes.\nBut instead of just writing contents on the monitor, it also writes the contents into circular files.\nAs I was in need of this library to find the behaviour of my IoT devices, I developed it.\nThe core is a C library module based on the following repository:\n\nhttps://github.com/SergiusTheBest/plog\n\nIt uses node-gyp and node-addon-api packages to build.\n\n## How to build the project\nFirst you are supposed to install Node.js on your machine. then, to build the project run the following commands inside the project folder:\n```\nnpm install\nnpm run build\n```\nAfter running above commands, a `build` folder will be created which contains the compiled library inside the release folder.\n \n## How to use the package\nAfter building the package, cpplogger.node file will be in build/Release folder, which can be used as a Node.js library for logging purposes.\nThere is also a sample index.js file which shows how to use the package file.\n\n```js\nconst cpplogger = require('./build/Release/cpplogger.node')\n\ncpplogger.init(6,\"/home/mahdi/Desktop/cpplogger/plog.log\",1000000,4);\n\ncpplogger.LOGV(\"Log Verbose Mode.\");\n\ncpplogger.LOGD(\"Log Debug Mode.\");\n\ncpplogger.LOGI(\"Log Info Mode.\");\n\ncpplogger.LOGW(\"Log Warning Mode.\");\n\ncpplogger.LOGE(\"Log Error Mode.\");\n\ncpplogger.LOGF(\"Log Fatal Mode.\");\n```\n\nBy running following command some log contents will be shown on the monitor.\n```\nnode index.js\n```\nThe same contents will be saved on the plog.log file as I set the name of log files to be plog.log in init function.\n\n## Screenshots\n\nIn the following image you can see both the console output and plog.log file contents.\nA log record will be shown on both console and log file.\n\n \u003cimg src=\"https://github.com/monhi/cpplogger/blob/main/image.png\" width=\"405\"\u003e \n\n\n## init function settings\nTo start the logging process, we are supposed to run `cpplogger.init` functions.\n\nFor settings of the init function please refere to  [original repo](https://github.com/SergiusTheBest/plog).\n\nFor logging purposes, we use one of the following functions:\n\n- cpplogger.LOGV\t-\u003e\tVerbose mode logging\n- cpplogger.LOGD\t-\u003e\tDebug mode logging\n- cpplogger.LOGI\t-\u003e\tInfo mode logging\n- cpplogger.LOGW\t-\u003e\tWarning mode logging\n- cpplogger.LOGE\t-\u003e\tError mode logging\n- cpplogger.LOGF\t-\u003e\tFatal mode logging\n\n## Current limitations\nJust only string input is supported for logging functions now. \nbut I would like to add other types also.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonhi%2Fcpplogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonhi%2Fcpplogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonhi%2Fcpplogger/lists"}