{"id":15929533,"url":"https://github.com/dan0xe/ta-logger","last_synced_at":"2025-03-24T17:31:23.230Z","repository":{"id":45910892,"uuid":"503126156","full_name":"Dan0xE/ta-logger","owner":"Dan0xE","description":"taLog is a frontend logger for Tauri applications, designed to log critical actions and store them locally for easy debugging and analysis.","archived":false,"fork":false,"pushed_at":"2023-05-26T12:55:48.000Z","size":1817,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T00:47:58.406Z","etag":null,"topics":["error-monitoring","error-reporting","logger","logger-interface","logging","tauri","tauri-app","tauri-plugin","tool"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ta-logger","language":"TypeScript","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/Dan0xE.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":"2022-06-13T21:53:59.000Z","updated_at":"2023-05-22T16:58:37.000Z","dependencies_parsed_at":"2022-08-22T19:20:27.612Z","dependency_job_id":null,"html_url":"https://github.com/Dan0xE/ta-logger","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/Dan0xE%2Fta-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dan0xE%2Fta-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dan0xE%2Fta-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dan0xE%2Fta-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dan0xE","download_url":"https://codeload.github.com/Dan0xE/ta-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245318928,"owners_count":20595866,"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":["error-monitoring","error-reporting","logger","logger-interface","logging","tauri","tauri-app","tauri-plugin","tool"],"created_at":"2024-10-07T00:04:30.202Z","updated_at":"2025-03-24T17:31:22.878Z","avatar_url":"https://github.com/Dan0xE.png","language":"TypeScript","readme":"# TaLog\n\n\u003e A frontend logger for Tauri applications, designed to log critical actions and store them locally for easy debugging and analysis.\n\n---\n\n## 🛠️ Configuration: Set Your Scopes\n\n### For the default directory name option:\nDefine the scopes in your Tauri configuration in the following manner:\n\n```json\n\"tauri\": {\n  \"allowlist\": {\n    \"fs\": {\n      \"createDir\": true,\n      \"writeFile\": true,\n      \"scope\": [\n        \"$DOCUMENT/YOUR_APP_NAME/logs\"\n      ]\n    }\n  }\n}\n```\n\nSubstitute **YOUR_APP_NAME** with the name found in your tauri config\n\n```json\n\"package\": {\n    \"productName\": \"test-app\", //\u003c--\n    ///\n  },\n```\n\n### For a custom directory name:\n\n```json\n\"scope\": [\"$DOCUMENT/CUSTOM_DIRNAME/logs\"]\n```\n\nWhere CUSTOM_DIRNAME is the name of the directory you want to use.\nUse the directory name that you specify here and pass it to the `customDirName` option as described below.\n\n\n---\n\n\n## 📝 Usage: Log Actions As Required\n\nLogging actions:\nUtilize the `log`, `warning`, or `error` methods in the TauriLogger class to log significant events within your critical functions or actions:\n\n```ts\nfunction criticalFunction() {\n  try {\n    taLog.log(\"critical function success\");\n  } catch (e) {\n    taLog.error(\"Crashed: \" + e);\n  }\n}\n```\n\n### Initialize the logger:\nFirst import `taLog` from the npm package.\nThen invoke the `initializeLogger` method with appropriate options:\n\n```ts\ntaLog.initializeLogger({\n  reportErrors: true,\n  customDirName: \"myCustomDir\",\n  diagnosticReport: true,\n  consoleLog: true\n});\n```\n\n## ⚙️ Options\n\n### Frontend error logging:\n\nBy default, errors are automatically logged. However, you can set the `reportErrors` option to **false** if you wish to disable automatic error logging.\n\n### Diagnostic report:\n\nThe logger provides a diagnostic report by default, which includes the application's name, version, and the utilized Tauri version. This feature can be disabled by setting the `diagnosticReport` option to **false**.\n\n### Console logging:\nBy default, logging to the console is disabled. It can be enabled by setting the `consoleLog` option to  **true**.\n\n### Custom directory:\nBy passing a `customDirName` option to the `initializeLogger` method, you can specify a custom directory for your log files.\n\n---\n\n## 🤝 Contributing\nShould you encounter any issues or wish to contribute, you're welcome to do so!\n\n\n\n\n\n\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdan0xe%2Fta-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdan0xe%2Fta-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdan0xe%2Fta-logger/lists"}