{"id":25709614,"url":"https://github.com/manigandand/log","last_synced_at":"2025-04-30T17:04:42.918Z","repository":{"id":57551812,"uuid":"213279846","full_name":"manigandand/log","owner":"manigandand","description":"Yet another Go Logger","archived":false,"fork":false,"pushed_at":"2019-11-11T12:00:27.000Z","size":11,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T17:04:37.383Z","etag":null,"topics":["codecov","godoc","golang","golangci","goreportcard","log","logdna","logging","loggly","pappertrail","travis-ci"],"latest_commit_sha":null,"homepage":null,"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/manigandand.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-10-07T02:29:41.000Z","updated_at":"2020-04-16T14:17:14.000Z","dependencies_parsed_at":"2022-09-20T13:06:55.255Z","dependency_job_id":null,"html_url":"https://github.com/manigandand/log","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/manigandand%2Flog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manigandand%2Flog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manigandand%2Flog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manigandand%2Flog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manigandand","download_url":"https://codeload.github.com/manigandand/log/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251748946,"owners_count":21637417,"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":["codecov","godoc","golang","golangci","goreportcard","log","logdna","logging","loggly","pappertrail","travis-ci"],"created_at":"2025-02-25T09:37:26.799Z","updated_at":"2025-04-30T17:04:42.876Z","avatar_url":"https://github.com/manigandand.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# log\n\n[![Go Report](https://goreportcard.com/badge/github.com/manigandand/log)](https://goreportcard.com/report/github.com/manigandand/log)\n[![GolangCI](https://golangci.com/badges/github.com/manigandand/log.svg)](https://golangci.com/r/github.com/manigandand/log)\n[![License](https://img.shields.io/badge/license-MIT%20License-blue.svg)](https://github.com/manigandand/log/blob/master/LICENSE)\n[![Build Status](https://img.shields.io/travis/manigandand/log?logo=travis\u0026style=for-the-badge)](https://travis-ci.org/manigandand/log)\n[![Coverage Status](https://img.shields.io/codecov/c/gh/manigandand/log.svg?logo=codecov\u0026style=for-the-badge)](https://codecov.io/gh/manigandand/log)\n[![](http://img.shields.io/badge/godoc-reference-5272B4.svg?style=for-the-badge)](https://godoc.org/github.com/manigandand/log)\n\nYet another Go Logger\n\nlog is simple extended version of standard 'log' package based on logLevel\nmost of the concepts inspired from [glog](https://godoc.org/github.com/golang/glog) and [tracelog](https://github.com/goinggo/tracelog) these packages are huge and complex.\n\nHence we writing our own log package with as simple as possible and extensible to third party logging systems such as Papertrail, Loggly, LogDNA.\n\n```golang\npackage main\n\nimport (\n\t\"flag\"\n\t\"io\"\n\t\"time\"\n\n\tsyslog \"log\"\n\n\t\"github.com/manigandand/log\"\n)\n\nvar (\n\tlogLevel = flag.String(\"log\", \"INFO\",\n\t\t\"log-level for the app valid choice INFO, WARNING, ERROR, FATAL, PANIC\")\n\tpapertrailAddr = flag.String(\"papertrail\", \"\",\n\t\t\"with valid papertrail address starts logging on papertrail.\")\n)\n\nfunc main() {\n\tflag.Parse()\n\n\t// init log\n\tvar multiWriter io.Writer\n\tif *papertrailAddr != \"\" {\n\t\tmultiWriter = \u0026log.Papertrail{Address: *papertrailAddr}\n\t}\n\tl, ok := log.Levels[*logLevel]\n\tif !ok {\n\t\tsyslog.Fatal(\"log: invalid log-level\")\n\t}\n\tlog.Init(l, multiWriter)\n\n\t// ex\n\tlog.Info(\"log info level example\")\n\tlog.Infof(\"%s---%d\", \"time\", time.Now().Unix())\n\tlog.Infoln(\"log info level example\")\n\n\tlog.Warning(\"log info level example\")\n\tlog.Warningf(\"%s---%d\", \"time\", time.Now().Unix())\n\tlog.Warningln(\"log info level example\")\n\n\tlog.Error(\"log info level example\")\n\tlog.Errorf(\"%s---%d\", \"time\", time.Now().Unix())\n\tlog.Errorln(\"log info level example\")\n\n\tlog.Fatal(\"log info level example\")\n\tlog.Fatalf(\"%s---%d\", \"time\", time.Now().Unix())\n\tlog.Fatalln(\"log info level example\")\n\n\tlog.Panic(\"log info level example\")\n\tlog.Panicf(\"%s---%d\", \"time\", time.Now().Unix())\n\tlog.Panicln(\"log info level example\")\n}\n\n```\n\n```Shell\nINFO: 2019/10/07 18:37:20 main.go:35: log info level example\nINFO: 2019/10/07 18:37:20 main.go:36: time---1570453640\nINFO: 2019/10/07 18:37:20 main.go:37: log info level example\n```\n\n```Shell\nWARNING: 2019/10/07 18:37:20 main.go:39: log info level example\nWARNING: 2019/10/07 18:37:20 main.go:40: time---1570453640\nWARNING: 2019/10/07 18:37:20 main.go:41: log info level example\n```\n\n```Shell\nERROR: 2019/10/07 18:37:20 main.go:43: log info level example\nERROR: 2019/10/07 18:37:20 main.go:44: time---1570453640\nERROR: 2019/10/07 18:37:20 main.go:45: log info level example\n```\n\n```Shell\nFATAL: 2019/10/07 18:37:20 main.go:47: log info level example\nexit status 1\n```\n\n```Shell\nPANIC: 2019/10/07 18:37:20 main.go:47: log info level example\nexit status 1\n```\n\n\u003e TODO:\n\n-   Context based logging.\n-   github.com/sirupsen/logrus\n-   github.com/uber-go/zap\n\n## Licence\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanigandand%2Flog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanigandand%2Flog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanigandand%2Flog/lists"}