{"id":22288445,"url":"https://github.com/sarathsp06/gologger","last_synced_at":"2025-07-28T22:32:49.133Z","repository":{"id":57481138,"uuid":"68512821","full_name":"sarathsp06/gologger","owner":"sarathsp06","description":"logger package for golang with echo middle ware support","archived":false,"fork":false,"pushed_at":"2021-07-29T15:37:14.000Z","size":28,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-06-20T07:47:28.235Z","etag":null,"topics":["golang","gologger","json","logger","logging"],"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/sarathsp06.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":"2016-09-18T09:59:06.000Z","updated_at":"2021-06-06T06:12:56.000Z","dependencies_parsed_at":"2022-09-26T17:41:27.900Z","dependency_job_id":null,"html_url":"https://github.com/sarathsp06/gologger","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/sarathsp06%2Fgologger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarathsp06%2Fgologger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarathsp06%2Fgologger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sarathsp06%2Fgologger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sarathsp06","download_url":"https://codeload.github.com/sarathsp06/gologger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227961828,"owners_count":17847841,"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","gologger","json","logger","logging"],"created_at":"2024-12-03T17:04:49.699Z","updated_at":"2024-12-03T17:04:49.873Z","avatar_url":"https://github.com/sarathsp06.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo of the project](http://www.davesgames.net/papercraft/png/gallery-logs-01.png)\n\n# gologger\n[![Build Status](https://travis-ci.org/sarathsp06/gologger.svg?branch=master)](https://travis-ci.org/sarathsp06/gologger)\n[![Join the chat at https://gitter.im/gologger/Lobby](https://badges.gitter.im/gologger/Lobby.svg)](https://gitter.im/gologger/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) [![Go Report Card](https://goreportcard.com/badge/github.com/sarathsp06/gologger)](https://goreportcard.com/report/github.com/sarathsp06/gologger)\n\u003e Logger library for the gophers\n\nAn openionated logging library for golang.Gologger writes logs as json in the following format\n\n```json\n{\n    \"time\":\"2016-11-10T16:11:46.59Z\",\n    \"process_name\":\"sample_logger\",\n    \"host_name\":\"sarath.local\",\n    \"process_id\":29422,\n    \"level\":\"ERROR\",\n    \"file_name\":\"/home/sarath/go/src/github.com/sarathsp06/gologger/sample/main.go\",\n    \"line_num\":13,\n    \"log_msg\":\"error happened\"\n}\n```  \n\nThat much info will be how following will be written\n```golang\nlogger.Error(\"error happened\")\n```\n\n## Installing / Getting started\n\nJust like any other go library\n\n```shell\ngo get github.com/sarathsp06/gologger\n```\nBut if one needs to get a particular version then use \n\n```shell\ngo get gopkg.in/sarathsp06/gologger.vx #x is the version Number\n``` \n\n\n## Developing\n\nHere's a brief intro about what a developer must do in order to start developing\nthe project further:\n\n1. Get it using go get or clone\n2. Make changes and make a pull reqeuest with Updated README if featue addition \n\n\n## Features\n\nWhat's all the bells and whistles this project can perform?\n* It can log - Obviously\n* Easy buffered logging \n* You can set write to logger for redirecting logs\n* log message will contain much deeper details like line number of error , process id,host_name  etc\n\n\n## How to use\nThis is how one may use the library\n\nimport the package \n```golang\nimport logger \"github.com/sarathsp06/gologger\"\n``` \nInitialize the  package \n```golang\nif err := logger.InitLogger(\"INFO\", \".\", \"sample_logger\",true); err != nil {\n\t\tpanic(err.Error())\n}\n```\nLog as you wish with formated and normal message\n\n```golang\nlogger.Error(\"error happened\")\nlogger.Debug(\"Debug message\",\":Sasa\",\"sasa\")\nlogger.Info(\"error happened\")\nlogger.Warning(\"error happened\")\nlogger.Errorf(\"error happened %s\", \"Yo\")\nlogger.Debugf(\"debug message : %s\", \"YoYo\")\n```\n\nExplore more ....\n\n\nHere is a sample code\n\n```golang\npackage main\n\nimport (\n\t\"os\"\n\tlogger \"github.com/sarathsp06/gologger\"\n)\n\nfunc main() {\n\tif err := logger.InitLogger(\"INFO\", \".\", \"sample_logger\",true); err != nil {\n\t\tpanic(err.Error())\n\t}\n\tlogger.SetLogWriter(os.Stdout)\n\tlogger.Error(\"error happened\")\n\tlogger.Debug(\"Debug message\")\n\tlogger.Info(\"error happened\")\n\tlogger.Warning(\"error happened\")\n\tlogger.Errorf(\"error happened %s\", \"Yo\")\n\tlogger.Debugf(\"debug message : %s\", \"YoYo\")\n}\n```\n\n## Licensing\n\n\n\"The code in this project is licensed under MIT license.\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarathsp06%2Fgologger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarathsp06%2Fgologger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarathsp06%2Fgologger/lists"}