{"id":17617390,"url":"https://github.com/andregkruger/golog","last_synced_at":"2026-05-16T00:32:25.389Z","repository":{"id":61624308,"uuid":"538220571","full_name":"AndreGKruger/golog","owner":"AndreGKruger","description":"Simple Logger","archived":false,"fork":false,"pushed_at":"2022-09-25T20:37:15.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T02:43:15.310Z","etag":null,"topics":["go","golang","json","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":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndreGKruger.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":"2022-09-18T19:36:43.000Z","updated_at":"2022-10-29T13:05:03.000Z","dependencies_parsed_at":"2022-10-19T18:45:47.955Z","dependency_job_id":null,"html_url":"https://github.com/AndreGKruger/golog","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreGKruger%2Fgolog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreGKruger%2Fgolog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreGKruger%2Fgolog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreGKruger%2Fgolog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndreGKruger","download_url":"https://codeload.github.com/AndreGKruger/golog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262492,"owners_count":20749170,"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","json","logger","logging"],"created_at":"2024-10-22T19:13:24.411Z","updated_at":"2026-05-16T00:32:25.345Z","avatar_url":"https://github.com/AndreGKruger.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golog\n\n## Introduction\nGolog is a very simple logging library for Go. It is designed to be simple to use and to be easy to integrate into existing projects.\n\n---\n\n## Installation\nTo install Golog, simply run the following command:\n\n    go get github.com/AndreGKruger/golog@latest\n\n---\n\n## Usage\nTo use Golog, simply import the package into your project:\n\n    import \"github.com/AndreGKruger/golog\"\n\nTo create a new logger, simply call the `New` function:\n\n    logger := golog.New()\n\nTo log a debug message, simply call the `Debug`, `Info`, `Warn` or `Error` function:\n\n    logger.Debug(\"This is a debug message\")\n    logger.Debug(\"This is a debug message with arguments\", arg1, arg2, arg3)\n    logger.Info(\"Hello, world!\")\n    logger.Info(\"Hello, world! with arguments\", arg1, arg2, arg3)\n    logger.Warn(\"Hello, world!\")\n    logger.Warn(\"Hello, world! with arguments\", arg1, arg2, arg3)\n    logger.Error(\"Hello, world!\")\n    logger.Error(\"Hello, world! with arguments\", arg1, arg2, arg3)\n\n---\n\n## Example output\nOutput\n\n    [ 2022/09/20 17:07:07 ] - [ENV:development] - [DEBUG]: sample log message  - [ARGS]: [{Test:Testing}]\n\n---\n\n## Configuration\nGolog can be configured to log to a file, to log to the console. To configure Golog, simply call the `Configure` function:\n\n    ok, err := logger.Configure(golog.Config{\n        LogEnvironment: golog.CONFIG_ENV_DEVELOPMENT,\n        LogFileName:    \"log.txt\",\n        LogTo:          golog.CONFIG_LOG_TO_CONSOLE,\n        OutputFormat:   golog.CONFIG_OUTPUT_FORMAT_TEXT,\n    })\n\nJson Output Format can be configured by passing the `OUTPUT_FORMAT_JSON` constant to the `OutputFormat` field of the `Config` struct:\n\n    OutputFormat: golog.CONFIG_OUTPUT_FORMAT_JSON,\n\n---\n\n## Environment logging\nBy default Golog will use the environment variable `GOLOG_ENV` to determine the log level. The following values are supported:\n    \n    GOLOG_ENV=development\n    GOLOG_ENV=staging\n    GOLOG_ENV=production\n\nThe GOLOG_ENV will override the environment variable that is set during the `SetEnvironment` function:\n    logger.SetEnvironment(golog.DEVELOPMENT)\n\n---\n\n## Log Levels\nGolog supports the following log levels:\n\n    CONFIG_LOG_LEVEL_DEBUG\n    CONFIG_LOG_LEVEL_INFO\n    CONFIG_LOG_LEVEL_WARN\n    CONFIG_LOG_LEVEL_ERROR\n\nBy default the following matrix of log levels and environments is used:\n\n    CONFIG_LOG_LEVEL_DEBUG: development\n    CONFIG_LOG_LEVEL_INFO: development, staging\n    CONFIG_LOG_LEVEL_WARN: development, staging, production\n    CONFIG_LOG_LEVEL_ERROR: development, staging, production\n\n---\n\n## Contributing\nIf you would like to contribute to Golog, please fork the repository and submit a pull request.\n\n---\n\n## License \nGNU General Public License v3.0 or later\nA copy of the license is available in the repository's `LICENSE` file.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandregkruger%2Fgolog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandregkruger%2Fgolog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandregkruger%2Fgolog/lists"}