{"id":19706898,"url":"https://github.com/jason916/peanut_core","last_synced_at":"2025-10-13T07:38:22.311Z","repository":{"id":64305653,"uuid":"110434643","full_name":"Jason916/peanut_core","owner":"Jason916","description":"A common logging package for Golang","archived":false,"fork":false,"pushed_at":"2019-03-21T05:24:48.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-10T12:56:59.210Z","etag":null,"topics":["go","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jason916.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":"2017-11-12T13:25:35.000Z","updated_at":"2019-03-21T05:24:49.000Z","dependencies_parsed_at":"2023-01-15T10:30:51.768Z","dependency_job_id":null,"html_url":"https://github.com/Jason916/peanut_core","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/Jason916%2Fpeanut_core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jason916%2Fpeanut_core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jason916%2Fpeanut_core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jason916%2Fpeanut_core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jason916","download_url":"https://codeload.github.com/Jason916/peanut_core/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241023682,"owners_count":19896109,"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","logger","logging"],"created_at":"2024-11-11T21:37:20.529Z","updated_at":"2025-10-13T07:38:17.283Z","avatar_url":"https://github.com/Jason916.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# peanut_core\nA common logging package for Golang\n\nlevel\n=\n* 5 levels: info trace error warning success\n\nerror\n=\n* logging when an error occurs and make it colored\n\ncolor\n=\n* support 'set default color' function\n* make msg colored\n\nwrite file\n=\n* by time\n* by size(default 1024)\n* write file at regular intervals\n* support rotate\n\nconfig\n=\n* get config from file\n\nCLI Installation\n=\n$ go get github.com/Jason916/peanut_core/log\n\nGetting Started\n=\n```go\npackage main\n\nimport (\n\t\"github.com/Jason916/peanut_core/log\"\n\t\"fmt\"\n)\n\nfunc init() {\n\n\t// set default color for logging\n\tlog.SetDefaultColor(log.DefaultColor)\n\n}\n\nfunc main() {\n\t// make msg colored\n\tlog.Trace(\"this is trace tag\")\n\n\tlog.Info(\"this is info tag\")\n\n\tlog.Success(\"this is success tag\")\n\n\t// write log file\n\tplogWriteConfig := log.NewPLogWriterConfig()\n\tplogWriter, err := log.NewPLogWriter(\".\", \"test_log\", true, plogWriteConfig)\n\n\tif err != nil{\n\t\tlog.Error(\"write log failed, cause by: \", err)\n\t\treturn\n\t}\n\n\tplog := log.NewPLogger(plogWriter)\n\tplog.PInfo(\"test info \")\n\tplog.PError(\"test write error\")\n\tplog.PTrace(\"test write trace\")\n\n\tif err := plog.PClose(); err != nil {\n\t\tfmt.Println(\"log close failed, cause by: \", err)\n\t}\n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjason916%2Fpeanut_core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjason916%2Fpeanut_core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjason916%2Fpeanut_core/lists"}