{"id":16829245,"url":"https://github.com/bwmarrin/lit","last_synced_at":"2025-04-11T04:03:12.229Z","repository":{"id":57495003,"uuid":"145231777","full_name":"bwmarrin/lit","owner":"bwmarrin","description":"Lit (Log it) is a simple and opinionated message logger for Go (golang).","archived":false,"fork":false,"pushed_at":"2019-08-13T13:26:10.000Z","size":17,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T04:03:02.894Z","etag":null,"topics":["go","golang","logger","logging"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bwmarrin.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":"2018-08-18T15:35:30.000Z","updated_at":"2022-09-14T19:15:28.000Z","dependencies_parsed_at":"2022-08-28T19:50:26.430Z","dependency_job_id":null,"html_url":"https://github.com/bwmarrin/lit","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/bwmarrin%2Flit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwmarrin%2Flit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwmarrin%2Flit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwmarrin%2Flit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwmarrin","download_url":"https://codeload.github.com/bwmarrin/lit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339285,"owners_count":21087215,"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":["go","golang","logger","logging"],"created_at":"2024-10-13T11:32:04.957Z","updated_at":"2025-04-11T04:03:12.209Z","avatar_url":"https://github.com/bwmarrin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"`lit` logs, so hot.\n====\n[![GoDoc](https://godoc.org/github.com/bwmarrin/lit?status.svg)](https://godoc.org/github.com/bwmarrin/lit) [![Go report](http://goreportcard.com/badge/bwmarrin/lit)](http://goreportcard.com/report/bwmarrin/lit) [![Build Status](https://travis-ci.org/bwmarrin/lit.svg?branch=master)](https://travis-ci.org/bwmarrin/lit) [![Discord Gophers](https://img.shields.io/badge/Discord%20Gophers-%23info-blue.svg)](https://discord.gg/0f1SbxBZjYq9jLBk)\n\n\u003cimg align=\"right\" src=\"https://source.unsplash.com/400x300/?log,fire\"\u003e\n\nlit is a [Go](https://golang.org/) package that provides\n* A very simple and opinionated message logger\n* Logging levels that allow you to set the verbosity of what is logged.\n* Added detail, such as file, line, and function name to each logged message.\n\n**For help with this package or general Go discussion, please join the [Discord \nGophers](https://discord.gg/0f1SbxBZjYq9jLBk) chat server.**\n\n## Status @ 2019-03-02\nThis package is pretty much where it's going to be, there's a chance of some\nminor changes in the future but otherwise I expect it to remain about like it is\nnow.\n\n## Design Goals\nI find somethings, like logging, a bit tedious.  So I wanted a way to have a\nvery accessible logger that I could use anywhere without needing much setup.  \n\nSo, lit has minimal configuration options, it doesn't require to be instantiated\nas a variable you pass around, or a global one you setup somewhere.  You can just\ncall the package functions from anywhere and there are handy methods for each of\nthe four log levels it supports.\n\n## Usage\n\nAdd the package to your project.\n\nLook around your code, and find a place that needs something logged.\n\nIf it's an error, just add a line like\n\n```go\nlit.Error(\"message here, %s\", err)\n```\n\nNow that error message will be logged.  \n\nIf it's something kind of spammy and not\neven an error at all - just detail you need when debugging your application.\n\n\n```go\nlit.Debug(\"message here\")\n```\n\nNow that will be logged anytime your `lit.LogLevel` is set to `lit.LogDebug`.\n\nThere's also `lit.Warning()` and `lit.Informational()` methods that can be used \nsimilarly.\n\n## Options\n\n### lit.LogLevel\nCan be set to `lit.LogError`, `lit.LogWarning`, `lit.LogInformational`, and \n`lit.LogDebug`.  The default is `lit.LogError`.\n\n### lit.Prefix\nCan be set to any string you want to prefix all logged messages. The default is \n`LIT`.\n\n### lit.Writer\nThis can be set to any io.Writer and that's where your logged messages will go. \nThe default is `os.Stderr`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwmarrin%2Flit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwmarrin%2Flit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwmarrin%2Flit/lists"}