{"id":36531993,"url":"https://github.com/spatialcurrent/go-sync-logger","last_synced_at":"2026-01-12T03:02:10.747Z","repository":{"id":92346643,"uuid":"167295084","full_name":"spatialcurrent/go-sync-logger","owner":"spatialcurrent","description":"A logger safe for concurrent use","archived":false,"fork":false,"pushed_at":"2019-10-06T21:50:24.000Z","size":17,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T16:47:56.944Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/spatialcurrent/go-sync-logger","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/spatialcurrent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-24T03:17:35.000Z","updated_at":"2019-10-06T21:50:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"a22c765c-d635-4b51-85bf-28851340066a","html_url":"https://github.com/spatialcurrent/go-sync-logger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/spatialcurrent/go-sync-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatialcurrent%2Fgo-sync-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatialcurrent%2Fgo-sync-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatialcurrent%2Fgo-sync-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatialcurrent%2Fgo-sync-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spatialcurrent","download_url":"https://codeload.github.com/spatialcurrent/go-sync-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spatialcurrent%2Fgo-sync-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28332842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-01-12T03:02:10.592Z","updated_at":"2026-01-12T03:02:10.723Z","avatar_url":"https://github.com/spatialcurrent.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/spatialcurrent/go-sync-logger/tree/master.svg?style=svg)](https://circleci.com/gh/spatialcurrent/go-sync-logger/tree/master) [![Go Report Card](https://goreportcard.com/badge/spatialcurrent/go-sync-logger)](https://goreportcard.com/report/spatialcurrent/go-sync-logger)  [![GoDoc](https://godoc.org/github.com/spatialcurrent/go-sync-logger?status.svg)](https://godoc.org/github.com/spatialcurrent/go-sync-logger) [![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://github.com/spatialcurrent/go-sync-logger/blob/master/LICENSE)\n\n# go-sync-logger\n\n# Description\n\n**go-sync-logger** (aka GSL) is a simple concurrency-safe library for sharing writers (e.g., stdout, errors.log, etc.) among multiple log levels.  With **GSL** you can have `info` and `error` messages share a log with messages being written in the proper sequence.\n\n **go-sync-logger** depends on:\n- [go-reader-writer](https://github.com/spatialcurrent/go-reader-writer) for writing to arbitrary locations.\n- [go-simple-serializer](https://github.com/spatialcurrent/go-simple-serializer) for serializing log messages.\n\n# Usage\n\n**Go**\n\nYou can import **go-sync-logger** as a library with:\n\n```go\nimport (\n  \"github.com/spatialcurrent/go-sync-logger/gsl\"\n)\n```\n\nTo initialize the logger, use `gsl.NewLogger` and pass it the writers, formats, and proper mapping of levels to writers.  For example, the configuration below, has `error` and `warn` share a writer.\n\n```go\n... () {\n  logger := gsl.NewLogger(\n    map[string]int{\"info\": 0, \"error\": 1, \"warn\": 1},\n    []grw.ByteWriteCloser{infoWriter, errorWriter},\n    []string{infoFormat, errorFormat},\n  )\n}\n```\n\nFor a complete example on how to initialize the logger using configuration provided by [viper](https://github.com/spf13/viper) see [viper.md](https://github.com/spatialcurrent/go-sync-logger/tree/master/example/viper.md) in [examples](https://github.com/spatialcurrent/go-sync-logger/tree/master/example).\n\nSee [gsl](https://godoc.org/github.com/spatialcurrent/go-sync-logger/gsl) in GoDoc for information on how to use Go API.\n\n# Contributing\n\n[Spatial Current, Inc.](https://spatialcurrent.io) is currently accepting pull requests for this repository.  We'd love to have your contributions!  Please see [Contributing.md](https://github.com/spatialcurrent/go-sync-logger/blob/master/CONTRIBUTING.md) for how to get started.\n\n# License\n\nThis work is distributed under the **MIT License**.  See **LICENSE** file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatialcurrent%2Fgo-sync-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspatialcurrent%2Fgo-sync-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspatialcurrent%2Fgo-sync-logger/lists"}