{"id":23159159,"url":"https://github.com/uptutu/log","last_synced_at":"2025-06-23T14:38:02.857Z","repository":{"id":57617255,"uuid":"382298838","full_name":"uptutu/log","owner":"uptutu","description":" Uber-go/Zap wrapper , make log easily.","archived":false,"fork":false,"pushed_at":"2021-10-08T10:23:09.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T18:47:36.935Z","etag":null,"topics":["go","log"],"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/uptutu.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":"2021-07-02T09:37:08.000Z","updated_at":"2021-11-07T10:35:24.000Z","dependencies_parsed_at":"2022-08-29T05:40:17.107Z","dependency_job_id":null,"html_url":"https://github.com/uptutu/log","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/uptutu/log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptutu%2Flog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptutu%2Flog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptutu%2Flog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptutu%2Flog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uptutu","download_url":"https://codeload.github.com/uptutu/log/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uptutu%2Flog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261495870,"owners_count":23167386,"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","log"],"created_at":"2024-12-17T22:32:19.308Z","updated_at":"2025-06-23T14:38:02.836Z","avatar_url":"https://github.com/uptutu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Log\n\n## Introduction\n\nWrap Uber-go /Zap make log easily.\n\n## Installation\n\n```shell\ngo get github.com/uptutu/log\n```\n\n## Usage\n\nEasy way to use. This `New()` will set working directory as default config to this `logger` save log info.\n\n```go\nimport (\n\"github.uptutu/log\"\n)\n\nfunc main() {\nlog.New()\nlog.Info(\"xxxxx\")\nlog.Debug(\"xxxxx\")\n}\n```\n\nEdit the config as you want, `Config` field is `uber-go/Zap` config, ArchConf as you want, if set `nil` to this field\nthen\n`logger` disable archive.\n\n```go\nimport (\n\"github.uptutu/log\"\n)\n\nfunc main() {\nconf := log.NewDefaultConfig()\nconf.ArchConf = nil\nlog.NewLogger(conf)\n\nlog.Info(\"xxxxx\")\nlog.Debug(\"xxxxx\")\n}\n```\n\ndefault config info:\n\n```go\nzap.Config{\n    Level:            NewAtomicLevelAt(DebugLevel),\n    Development:      true,\n    Encoding:         \"console\",\n    EncoderConfig:    NewDevelopmentEncoderConfig(),\n    OutputPaths:      []string{\"stderr\"},\n    ErrorOutputPaths: []string{\"stderr\"},\n}\nzapcore.EncoderConfig{\n    TimeKey:        \"timestamp\",\n    LevelKey:       \"level\",\n    NameKey:        \"logger\",\n    CallerKey:      \"caller\",\n    FunctionKey:    zapcore.OmitKey,\n    MessageKey:     \"content\",\n    StacktraceKey:  \"stacktrace\",\n    LineEnding:     zapcore.DefaultLineEnding,\n    EncodeLevel:    zapcore.LowercaseLevelEncoder,\n    EncodeTime:     zapcore.ISO8601TimeEncoder,\n    EncodeDuration: zapcore.SecondsDurationEncoder,\n    EncodeCaller:   zapcore.ShortCallerEncoder,\n}\n\nArchiveConfig{\n    LogFileDir:    \"\", // Default will change this \"\" to Working directory\n    ErrorFileName: \"error.log\",\n    WarnFileName:  \"warn.log\",\n    InfoFileName:  \"info.log\",\n    DebugFileName: \"debug.log\",\n    MaxSize:       11,\n    MaxBackups:    10,\n    MaxAge:        30,\n    Compress:      false,\n}\n\n```\n\nWhen you already `New()` that config was build a `logger` register to `Zap`\nyou can use `zap.L()` get this `logger` by `zap` or get this by this package `log.Get()`\n\n```go\nimport (\n\"github.uptutu/log\"\n)\n\nfunc main() {\nconf := log.NewDefaultConfig()\nconf.ArchConf = nil\nlog.NewLogger(conf)\n\nlog.Get().Info(\"xxxxx\")\nlog.Get().Debug(\"xxxxx)\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuptutu%2Flog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuptutu%2Flog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuptutu%2Flog/lists"}