{"id":15486891,"url":"https://github.com/codenoid/telelog","last_synced_at":"2025-04-22T17:28:14.969Z","repository":{"id":57548192,"uuid":"304083524","full_name":"codenoid/telelog","owner":"codenoid","description":"Embed to your app or tail a file, send the log to your telegram account \u0026/ group","archived":false,"fork":false,"pushed_at":"2021-09-08T13:24:47.000Z","size":79,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T17:12:46.674Z","etag":null,"topics":["golang","logger","telegram"],"latest_commit_sha":null,"homepage":"","language":"Go","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/codenoid.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":"2020-10-14T17:10:11.000Z","updated_at":"2023-11-24T17:28:42.000Z","dependencies_parsed_at":"2022-08-28T11:22:46.642Z","dependency_job_id":null,"html_url":"https://github.com/codenoid/telelog","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/codenoid%2Ftelelog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenoid%2Ftelelog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenoid%2Ftelelog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenoid%2Ftelelog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codenoid","download_url":"https://codeload.github.com/codenoid/telelog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250286726,"owners_count":21405491,"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":["golang","logger","telegram"],"created_at":"2024-10-02T06:20:20.639Z","updated_at":"2025-04-22T17:28:14.950Z","avatar_url":"https://github.com/codenoid.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telelog\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/codenoid/telelog.svg)](https://pkg.go.dev/github.com/codenoid/telelog)\n\nEmbed to app or tail a file, the log will send to your telegram (chat_id)\n\n![Telegram Notification](telelog.jpg?raw=true)\n\n## Installation\n\nEmbed to your app using Go Modules\n\n```bash\ngo get github.com/codenoid/telelog\n```\n\nCLI version\n\n```bash\ngo get github.com/codenoid/telelog/cmd/telelog\n```\n\n## Usage\n\nExample of recipient file content (text file) : \n\n```txt\n999838460\n961268461\n827957192\n```\n\nCMD Example :\n\nyou must set env var for cli version !\n\n```bash\n$ codenoid\u003e telelog \nTelelog, make sure you already set these env : \nTELELOG_BOT_TOKEN\nTELELOG_APP_NAME\nTELELOG_DEBUG_MODE (optional)\nTELELOG_RECIPIENT_LIST\n\n$ codenoid\u003e telelog -file ./path/to/error.log -level error\n```\n\nCode Example :\n\n```go\npackage main\n\nimport (\n    \"time\"\n\n    \"github.com/codenoid/telelog\"\n)\n\nfunc main() {\n    logger := telelog.LoggerNew()\n\n    // default TELELOG_BOT_TOKEN, unless you call SetToken\n    logger.SetToken(\"1125121251:AAF2sfBCbKjag8LhUIAzf1mzk36BxcJ0Mvg\")\n\n    // default TELELOG_APP_NAME, unless you call SetAppName\n    logger.SetAppName(\"Uploader Service\")\n\n    // default TELELOG_DEBUG_MODE, unless you call SetDebug\n    // if true, any logger.Debug* log will be send \n    logger.SetDebug(false)\n\n    // default TELELOG_RECIPIENT_LIST (single path to file), unless you call SetRecipient\n    logger.SetRecipient(\"/path/to/text/file.txt\", \"/second/file/that/contain/chat_id.txt\")\n\n    // or reader\n    f, _ := os.Open(\"file.txt\")\n    logger.SetRecipientFromReader(f)\n\n    // or []byte\n    logger.SetRecipientFromByte([]byte{\"777000\\n\"})\n\n    logger.Warn(\"Warning! your app will be error\")\n    logger.Error(\"yo, this is error, in 2sec your app will dead\")\n    time.Sleep(2*time.Second)\n    logger.Fatal(\"lmaoo\")\n\n}\n```\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenoid%2Ftelelog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodenoid%2Ftelelog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenoid%2Ftelelog/lists"}