{"id":37174418,"url":"https://github.com/pleclech/glg","last_synced_at":"2026-01-14T20:22:53.998Z","repository":{"id":57509838,"uuid":"177809978","full_name":"pleclech/glg","owner":"pleclech","description":"Simple and fast lockfree logging library for golang","archived":false,"fork":true,"pushed_at":"2019-03-26T15:28:15.000Z","size":8765,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T06:24:00.638Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"kpango/glg","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pleclech.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":"2019-03-26T14:52:39.000Z","updated_at":"2024-06-20T06:24:00.639Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pleclech/glg","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/pleclech/glg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleclech%2Fglg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleclech%2Fglg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleclech%2Fglg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleclech%2Fglg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pleclech","download_url":"https://codeload.github.com/pleclech/glg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleclech%2Fglg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-14T20:22:52.813Z","updated_at":"2026-01-14T20:22:53.921Z","avatar_url":"https://github.com/pleclech.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glg [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/Apache-2.0) [![release](https://img.shields.io/github/release/kpango/glg.svg?style=flat-square)](https://github.com/kpango/glg/releases/latest) [![CircleCI](https://circleci.com/gh/kpango/glg.svg)](https://circleci.com/gh/kpango/glg) [![codecov](https://codecov.io/gh/kpango/glg/branch/master/graph/badge.svg?token=2CzooNJtUu\u0026style=flat-square)](https://codecov.io/gh/kpango/glg) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a6e544eee7bc49e08a000bb10ba3deed)](https://www.codacy.com/app/i.can.feel.gravity/glg?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=kpango/glg\u0026amp;utm_campaign=Badge_Grade) [![Go Report Card](https://goreportcard.com/badge/github.com/kpango/glg)](https://goreportcard.com/report/github.com/kpango/glg) [![GolangCI](https://golangci.com/badges/github.com/kpango/glg.svg?style=flat-square)](https://golangci.com/r/github.com/kpango/glg) [![Go Walker](http://gowalker.org/api/v1/badge)](https://gowalker.org/github.com/kpango/glg) [![GoDoc](http://godoc.org/github.com/kpango/glg?status.svg)](http://godoc.org/github.com/kpango/glg) [![DepShield Badge](https://depshield.sonatype.org/badges/kpango/glg/depshield.svg)](https://depshield.github.io) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fkpango%2Fglg.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkpango%2Fglg?ref=badge_shield)\n\n\nglg is simple golang logging library\n\n## Requirement\nGo 1.11\n\n## Installation\n```shell\ngo get github.com/kpango/glg\n```\n\n## Example\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/kpango/glg\"\n)\n\n// NetWorkLogger sample network logger\ntype NetWorkLogger struct{}\n\nfunc (n NetWorkLogger) Write(b []byte) (int, error) {\n\t// http.Post(\"localhost:8080/log\", \"\", bytes.NewReader(b))\n\thttp.Get(\"http://127.0.0.1:8080/log\")\n\tglg.Success(\"Requested\")\n\tglg.Infof(\"RawString is %s\", glg.RawString(b))\n\treturn 1, nil\n}\n\nfunc main() {\n\n\t// var errWriter io.Writer\n\t// var customWriter io.Writer\n\tinfolog := glg.FileWriter(\"/tmp/info.log\", 0666)\n\n\tcustomTag := \"FINE\"\n\tcustomErrTag := \"CRIT\"\n\n\terrlog := glg.FileWriter(\"/tmp/error.log\", 0666)\n\tdefer infolog.Close()\n\tdefer errlog.Close()\n\tglg.Get().\n\t\tSetMode(glg.BOTH). // default is STD\n\t\t// DisableColor().\n\t\t// SetMode(glg.NONE).\n\t\t// SetMode(glg.WRITER).\n\t\t// SetMode(glg.BOTH).\n\t\t// InitWriter().\n\t\t// AddWriter(customWriter).\n\t\t// SetWriter(customWriter).\n\t\t// AddLevelWriter(glg.LOG, customWriter).\n\t\t// AddLevelWriter(glg.INFO, customWriter).\n\t\t// AddLevelWriter(glg.WARN, customWriter).\n\t\t// AddLevelWriter(glg.ERR, customWriter).\n\t\t// SetLevelWriter(glg.LOG, customWriter).\n\t\t// SetLevelWriter(glg.INFO, customWriter).\n\t\t// SetLevelWriter(glg.WARN, customWriter).\n\t\t// SetLevelWriter(glg.ERR, customWriter).\n\t\tAddLevelWriter(glg.INFO, infolog).                         // add info log file destination\n\t\tAddLevelWriter(glg.ERR, errlog).                           // add error log file destination\n\t\tAddStdLevel(customTag, glg.STD, false).                    //user custom log level\n\t\tAddErrLevel(customErrTag, glg.STD, true).                  // user custom error log level\n\t\tSetLevelColor(glg.TagStringToLevel(customTag), glg.Cyan).  // set color output to user custom level\n\t\tSetLevelColor(glg.TagStringToLevel(customErrTag), glg.Red) // set color output to user custom level\n\n\tglg.Info(\"info\")\n\tglg.Infof(\"%s : %s\", \"info\", \"formatted\")\n\tglg.Log(\"log\")\n\tglg.Logf(\"%s : %s\", \"info\", \"formatted\")\n\tglg.Debug(\"debug\")\n\tglg.Debugf(\"%s : %s\", \"info\", \"formatted\")\n\tglg.Warn(\"warn\")\n\tglg.Warnf(\"%s : %s\", \"info\", \"formatted\")\n\tglg.Error(\"error\")\n\tglg.Errorf(\"%s : %s\", \"info\", \"formatted\")\n\tglg.Success(\"ok\")\n\tglg.Successf(\"%s : %s\", \"info\", \"formatted\")\n\tglg.Fail(\"fail\")\n\tglg.Failf(\"%s : %s\", \"info\", \"formatted\")\n\tglg.Print(\"Print\")\n\tglg.Println(\"Println\")\n\tglg.Printf(\"%s : %s\", \"printf\", \"formatted\")\n\tglg.CustomLog(customTag, \"custom logging\")\n\tglg.CustomLog(customErrTag, \"custom error logging\")\n\n\tglg.Get().AddLevelWriter(glg.DEBG, NetWorkLogger{}) // add info log file destination\n\n\thttp.Handle(\"/glg\", glg.HTTPLoggerFunc(\"glg sample\", func(w http.ResponseWriter, r *http.Request) {\n\t\tglg.New().\n\t\tAddLevelWriter(glg.Info, NetWorkLogger{}).\n\t\tAddLevelWriter(glg.Info, w).\n\t\tInfo(\"glg HTTP server logger sample\")\n\t}))\n\n\thttp.ListenAndServe(\"port\", nil)\n\n\t// fatal logging\n\tglg.Fatalln(\"fatal\")\n}\n```\n\n![Sample Logs](https://github.com/kpango/glg/raw/master/images/sample.png)\n\n## Benchmarks\n\n![Bench](https://github.com/kpango/glg/raw/master/images/bench.png)\n\n## Contribution\n1. Fork it ( https://github.com/kpango/glg/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request\n\n## Author\n[kpango](https://github.com/kpango)\n\n## LICENSE\nglg released under MIT license, refer [LICENSE](https://github.com/kpango/glg/blob/master/LICENSE) file.  \n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fkpango%2Fglg.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkpango%2Fglg?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpleclech%2Fglg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpleclech%2Fglg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpleclech%2Fglg/lists"}