From 50e9a6c86c763cbac2c08fbf1712c5e0407bf999 Mon Sep 17 00:00:00 2001 From: Ignacio Olave Date: Sun, 28 Jul 2024 21:40:47 -0400 Subject: [PATCH] added v0.1.0 release changes --- CHANGELOG.md | 19 +++++++++++++++++++ README.md | 26 +++++++++++++------------- 2 files changed, 32 insertions(+), 13 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..bf287ed --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,19 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [v0.1.0] - 2024-07-28 + +### Added + +- LOG_LEVEL environment variable support. +- LOG_LEVEL constants. +- Debug, Info, Warn, Error and Fatal log methods. +- String helper method that converts strings to their snake case version. + +[0.1.0]: https://github.com/iolave/go-logger/releases/tag/v0.1.0 diff --git a/README.md b/README.md index 1a9c6a3..b78b55b 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ go get github.com/iolave/go-logger ## Environment variables -| Variable | Description | Default value | -|-----------|-------------|---------------| -| LOG_LEVEL | Accepts any name value of the [log level definition](#log-level-definition). | `info` | +| Variable | Description | Default value | +|-------------|-------------|---------------| +| `LOG_LEVEL` | Accepts any name value of the [log level definition](#log-level-definition). | `info` | ## Usage @@ -43,16 +43,16 @@ logger.Fatal("fatal message", map[string]any{}) ### Log entry schema -| Field | Description | -|---------------|----------------------------------| -| level | Log entry level | -| name | Name of the app/logger | -| msg | Log message in snake case format | -| time | Unix time | -| pid | Process id | -| hostname | System's hostname | -| schemaVersion | This schema version (v1.0.0) | -| customData | Custom data in any form or shape. Feel free to use this field as you want | +| Field | Description | JSON type | +|---------------|----------------------------------|-----------| +| level | Log entry level | `number` | +| name | Name of the app/logger | `string` | +| msg | Log message in snake case format | `string` | +| time | Unix time | `number` | +| pid | Process id | `number` | +| hostname | System's hostname | `string` | +| schemaVersion | This schema version (v1.0.0) | `string` | +| customData | Custom data in any form or shape. Feel free to use this field as you want | `Record` | ### Log level definition | Level | Name |