{"id":13763732,"url":"https://github.com/sadlil/gologger","last_synced_at":"2025-05-10T17:30:54.435Z","repository":{"id":57488710,"uuid":"41790658","full_name":"sadlil/gologger","owner":"sadlil","description":"The Simplest and worst logging library ever written","archived":true,"fork":false,"pushed_at":"2018-01-31T03:17:58.000Z","size":30,"stargazers_count":41,"open_issues_count":2,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-12T18:41:21.229Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sadlil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-02T08:52:26.000Z","updated_at":"2025-02-10T13:30:24.000Z","dependencies_parsed_at":"2022-08-29T15:02:01.475Z","dependency_job_id":null,"html_url":"https://github.com/sadlil/gologger","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadlil%2Fgologger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadlil%2Fgologger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadlil%2Fgologger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sadlil%2Fgologger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sadlil","download_url":"https://codeload.github.com/sadlil/gologger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253453202,"owners_count":21911058,"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":[],"created_at":"2024-08-03T15:00:57.276Z","updated_at":"2025-05-10T17:30:53.758Z","avatar_url":"https://github.com/sadlil.png","language":"Go","funding_links":[],"categories":["Logging","日志记录","Relational Databases","\u003cspan id=\"日志-logging\"\u003e日志 Logging\u003c/span\u003e","日志","Logging 日志库"],"sub_categories":["Advanced Console UIs","检索及分析资料库","Search and Analytic Databases","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","SQL 查询语句构建库","交流"],"readme":"# gologger\n\nA Simple Easy to use go logger library.  Displays Colored log into console in any unix or windows platform.\nYou can even store your logs in file, ElasticSearch or MySQL Database.\n\n\n#### Developed:\n    - Colored and Simple Log into Console\n    - File Logging\n    - ElasticSearch Logging\n\n\n#### How to Get:\n``` sh\n$ go get github.com/sadlil/gologger\n```\n#### How To Use:\n``` go\nimport \"github.com/sadlil/gologger\"\n\nConsole::\nlogger = gologger.GetLogger(gologger.CONSOLE, gologger.SimpleLog)\n// Displays Simple plain log in console\n\nlogger = gologger.GetLogger(gologger.CONSOLE, gologger.ColoredLog)\n// Displays Colorful log in console\n\n\nFile::\nlogger = gologger.GetLogger(gologger.FILE, fileName)\n// Log all the message in the given file.\n// If file is not presents then creates it. if filename is \"\" creates\n// a default file named logs.txt in ur project directory.\n\n\nElasticSearch::\nlogger = gologger.GetLogger(gologger.ELASTICSEARCH, location)\n// Logs everything into elasticsearch. if location is \"\" then it\n// looks for elasticsearch by default in http://localhost:9200\n// and logs stored in index 'gologger'.\n// If you want to provide custom location and index for your log\n// you must provide the location in this format\n// \"http://Your_ES_Url:ES_Port/Index\",\n// If you only want to change the default index name you can do that\n// by sending \"/YourIndex\", it will use default localhost for ES.\n```\n#### Display:\n``` go\nlogger.Log(Message) -\u003e displays in console.\n```\n``` sh\n[Log] [Time] [Package Name::File Name::Function Name] [Line Number] Message\n```\n#### Logger Functions Available:\n``` go\nlogger.Log(message string)\nlogger.Message(message string)\nlogger.Info(message string)\nlogger.Warn(message string)\nlogger.Debug(message string)\nlogger.Error(message string)\n```\n#### You can use two or more same type or diffrent type logger in same application.\n``` go\nlogger1 = gologger.GetLogger(gologger.CONSOLE, gologger.SimpleLog)\nlogger2 = gologger.GetLogger(gologger.FILE, \"filelog.log\")\n\nlogger1.log(\"Hello Console\") // loges into console.\nlogger2.log(\"Hello File\") // loges into file.\n```\n\n\n  **Any suggestion and Issue would be highly appreciated**. You can create an issue or pull request\n  if you think i need to modify my library.\n\n\n#### Used Libraries\n1. Color Console - [faith/color](https://github.com/fatih/color)\n2. ElasticSearch - [olivere/elastic](https://github.com/olivere/elastic)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadlil%2Fgologger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsadlil%2Fgologger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadlil%2Fgologger/lists"}