{"id":17742928,"url":"https://github.com/iktakahiro/slclogger","last_synced_at":"2025-08-03T22:35:40.805Z","repository":{"id":66182834,"uuid":"76031566","full_name":"iktakahiro/slclogger","owner":"iktakahiro","description":"Simple and Human Friendly Slack Client for Logging Written in Go Programming Language","archived":false,"fork":false,"pushed_at":"2019-03-14T01:34:54.000Z","size":86,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-21T08:44:45.680Z","etag":null,"topics":["go","golang","logging","slack","slack-client"],"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/iktakahiro.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-09T11:55:15.000Z","updated_at":"2025-02-11T21:33:01.000Z","dependencies_parsed_at":"2023-02-23T01:15:34.225Z","dependency_job_id":null,"html_url":"https://github.com/iktakahiro/slclogger","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/iktakahiro/slclogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktakahiro%2Fslclogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktakahiro%2Fslclogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktakahiro%2Fslclogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktakahiro%2Fslclogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iktakahiro","download_url":"https://codeload.github.com/iktakahiro/slclogger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iktakahiro%2Fslclogger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268623844,"owners_count":24280144,"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","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["go","golang","logging","slack","slack-client"],"created_at":"2024-10-26T05:42:07.505Z","updated_at":"2025-08-03T22:35:40.732Z","avatar_url":"https://github.com/iktakahiro.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SlcLogger\n\n[![Build Status](https://travis-ci.org/iktakahiro/slclogger.svg?branch=master)](https://travis-ci.org/iktakahiro/slclogger)\n\n**Simple and Human Friendly Slack Client for Logging/Notification written in Go**\n\n## Install\n\n```bash\ngo get \"github.com/iktakahiro/slclogger/v2\"\n```\n\n## How to Use\n\n### Basic Usage\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\n\t\"github.com/iktakahiro/slclogger/v2\"\n)\n\nfunc something() error {\n\treturn errors.New(\"an error has occurred\")\n}\n\nfunc main() {\n\n\tlogger, _ := slclogger.NewSlcLogger(\u0026slclogger.LoggerParams{\n\t\tWebHookURL: \"https://hooks.slack.com/services/YOUR_WEBHOOK_URL\",\n\t})\n\n\tif err := something(); err != nil {\n\t\tlogger.Error(err, \"Error Notification\")\n\t}\n}\n```\n\nWhen you execute the above sample code, your Slack channel will receive the message.\n\n![](./example/example-slack1.png)\n\n### Log Levels\n\nThe default log level is *Info*. You can set it when initializing a SlcLogger struct.\n\n```go\npackage main\n\nimport (\n\t\"github.com/iktakahiro/slclogger/v2\"\n)\n\nfunc main() {\n    logger, _ := slclogger.NewSlcLogger(\u0026slclogger.LoggerParams{\n        WebHookURL: \"https://hooks.slack.com/services/YOUR_WEBHOOK_URL\",\n        LogLevel: slclogger.LevelDebug,\n    })\n\n    logger.Debug(\"Debug Message\")\n    logger.Info(\"Info Message\")\n    logger.Warn(\"Warn Message\")\n    logger.Error(\"Error Message\")\n}\n```\n\n![](./example/example-slack2.png)\n\nYou can also change the level at any time.\n\n```go\npackage main\n\nimport (\n\t\"github.com/iktakahiro/slclogger/v2\"\n)\n\nfunc main() {\n\tlogger, _ := slclogger.NewSlcLogger(\u0026slclogger.LoggerParams{\n\t\tWebHookURL: \"https://hooks.slack.com/services/YOUR_WEBHOOK_URL\",\n\t})\n\n    logger.SetLogLevel(slclogger.LevelWarn)\n\n    // The following notification will be ignored.\n    logger.Debug(\"Debug Message\")\n}\n```\n\n### Configure Options\n\nAll options are shown below.\n\n```go\npackage main\n\nimport (\n\t\"github.com/iktakahiro/slclogger/v2\"\n)\n\nfunc main() {\n\n    logger, err := slclogger.NewSlcLogger(\u0026slclogger.LoggerParams{\n        WebHookURL:         \"https://hooks.slack.com/services/YOUR_WEBHOOK_URL\",\n        DefaultTitle:       \"Default Title\",\n        DefaultChannel:     \"general\",\n        DebugChannel:       \"debug-channel\",\n        InfoChannel:        \"info-channel\",\n        WarnChannel :       \"warn-channel\",\n        ErrorChannel :      \"error-channel\",\n        LogLevel:           slclogger.LevelWarn,\n        IconURL:            \"https://example.com\",\n        UserName:           \"My Logger\",\n    })\n}\n```\n\nParam | Default Value\n------ | ------------\nWebHookURL (*require*) | --\nDefaultTitle | \"Notification\"\nDefaultChannel | \"\" (When this param is omitted, the default channel of specified WebHook is used.)\nDebugChannel | \"\" (When this param is omitted, the value of DefaultChannel is used.)\nInfoChannel | \"\" (When this param is omitted,  the value of DefaultChannel is used.)\nWarnChannel | \"\" (When this param is omitted,  the value of DefaultChannel  is used.)\nErrorChannel | \"\" (When this param is omitted, the value of DefaultChannel  is used.)\nLogLevel | Info\nIconURL | \"\"\nUseName | \"\"\n\n## Error Handling\n\nIf you want to handle errors, use SlcErr.\n\n```go\nif err := logger.Info(\"info message\"); err != nil {\n    if slcErr, ok := err.(*slclogger.SlcErr); ok {\n        fmt.Println(slcErr)\n        fmt.Println(slcErr.Code)\n    }\n}\n```\n\n## Test\n\n```bash\nmake test\n```\n\n## Documents\n\n- [slclogger \\- GoDoc](https://godoc.org/github.com/iktakahiro/slclogger)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiktakahiro%2Fslclogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiktakahiro%2Fslclogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiktakahiro%2Fslclogger/lists"}