{"id":23451228,"url":"https://github.com/peak/picolo","last_synced_at":"2025-04-13T20:15:20.008Z","repository":{"id":46930577,"uuid":"184226012","full_name":"peak/picolo","owner":"peak","description":"Logging package for go","archived":false,"fork":false,"pushed_at":"2021-09-21T08:14:29.000Z","size":14,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-13T20:15:14.468Z","etag":null,"topics":[],"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/peak.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":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2019-04-30T08:46:15.000Z","updated_at":"2022-07-14T10:45:41.000Z","dependencies_parsed_at":"2022-09-26T22:30:28.871Z","dependency_job_id":null,"html_url":"https://github.com/peak/picolo","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/peak%2Fpicolo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peak%2Fpicolo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peak%2Fpicolo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peak%2Fpicolo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peak","download_url":"https://codeload.github.com/peak/picolo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248774968,"owners_count":21159534,"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-12-24T00:19:54.784Z","updated_at":"2025-04-13T20:15:19.985Z","avatar_url":"https://github.com/peak.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)\n![Tag](https://img.shields.io/github/tag/peak/picolo.svg)\n[![godoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/peak/picolo)\n[![Go Report Card](https://goreportcard.com/badge/github.com/peak/picolo)](https://goreportcard.com/report/github.com/peak/picolo)\n[![Build Status](https://travis-ci.org/peak/picolo.svg?branch=master)](https://travis-ci.org/peak/picolo)\n\n# picolo\n\npicolo is a minimalistic logging library for go.\n\n# Usage\nIf no options are given, picolo assumes:\n* log level is `INFO`\n* output is `os.Stdout`\n* time format is `2006-01-02 15:04:05.000`\n* prefix is empty string\n\n```go\nl := picolo.New() // Use defaults\nl.Infof(\"Info message\")\n// 2019-04-29 15:34:32.166 INFO Info message\n```\n\n`prefix` can be set with `picolo.WithPrefix` option.\n\n```go\nl = picolo.New(picolo.WithPrefix(\"[some-prefix]\")) // constructor with optional prefix\nl.Infof(\"Info message\")\n// 2019-04-29 22:23:24.256 INFO [some-prefix] Info message\n```\n\nSub loggers can be created from an existing logger with `picolo.NewFrom` constructor function.\n```go\n// Create sub-logger, appending prefix\nk := picolo.NewFrom(l, \"[more-prefix]\")\nk.Errorf(\"Error message: %v\", err)\n//  2019-04-29 23:24:25.267 ERROR [some-prefix] [more-prefix] Error message: No such file or directory\n```\n\n# Log Levels\npicolo supports 4 types of log levels:\n* DEBUG\n* INFO\n* WARNING\n* ERROR\n\n# Options\n\nThe constructor accepts several options:\n\n    WithLevel(level Level)                     // Set level\n    WithOutput(output io.Writer)               // Set output\n    WithPrefix(prefix string)                  // Set prefix\n    WithTimeFormat(format string, utc bool)    // Set time format and UTC flag\n\n\n# Helpers\n\nUse `picolo.LevelFromString` to parse a string into a log level. This can be used like:\n\n```go\n// ...\nl := flag.String(\"logLevel\", \"debug\", \"Log level\")\nflag.Parse()\n\nlvl, err := picolo.LevelFromString(*l)\nif err != nil {\n\t// Unknown log level\n}\n\nlogger := picolo.New(picolo.WithLevel(lvl))\nlogger.Infof(\"Logger is ready.\")\n// ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeak%2Fpicolo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeak%2Fpicolo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeak%2Fpicolo/lists"}