Skip to content

Releases: rokwire/logging-library-go

v2.3.0

Choose a tag to compare

@shurwit shurwit released this 29 Feb 20:32
568876e

[2.3.0] - 2024-02-29

Added

  • Expose access to log trace ID, span ID, and context #28
  • Log context in all output #29

Full Changelog: https://github.com/rokwire/logging-library-go/blob/main/CHANGELOG.md

v2.2.0

Choose a tag to compare

@shurwit shurwit released this 19 Jan 17:26
3299bd9

[2.2.0] - 2023-01-19

Added

  • Handle HTTP Cookies #25
  • Expose internal errors #23

Full Changelog: https://github.com/rokwire/logging-library-go/blob/main/CHANGELOG.md

V2.1.0

Choose a tag to compare

@shurwit shurwit released this 01 Dec 16:25
1ec9350

[2.1.0] - 2022-12-01

Added

  • Regex in HTTPRequestProperties #20

Full Changelog: https://github.com/rokwire/logging-library-go/blob/main/CHANGELOG.md

v2.0.0

Choose a tag to compare

@shurwit shurwit released this 16 Nov 15:57

BREAKING

This release includes breaking changes. Please see the "Migration steps' below for instructions on upgrading to this version.

[2.0.0] - 2022-11-16

Added

  • Return trace ID in error responses #13
  • Add OpenShift health check request properties builder for log suppression #14

Changed

  • BREAKING: Restructure logs package #16

Full Changelog: https://github.com/rokwire/logging-library-go/blob/main/CHANGELOG.md

Migration Steps

Follow the steps below to upgrade to the associated version of this library. Note that the steps for each version are cumulative, so if you are attempting to upgrade by several versions, be sure to make the changes described for each version between your current version and the latest.

Log.Request- Functions

The Log.Request- functions have been removed. These can be replaced by the equivalent Log.HTTPResponse- function followed by Log.SendHTTPResponse.

Example Replacement:

func (we WebAdapter) test(l *logs.Log, w http.ResponseWriter, req *http.Request) {

	...

    // Removed
    // l.RequestSuccess(w)
    l.SendHTTPResponse(w, l.HTTPResponseSuccess())
}

Removed Functions:

  • Log.RequestSuccess
  • Log.RequestSuccessAction
  • Log.RequestSuccessMessage
  • Log.RequestSuccessJSON
  • Log.RequestError
  • Log.RequestErrorAction
  • Log.RequestErrorData

Log.-Action and Log.-Data Functions

The Log.-Action and log.-Data functions have been removed. These can be replaced by logutils.MessageAction(orlogutils.MessageActionSuccess/logutils.MessageActionError) or logutils.MessageData` function followed by the equivalent log level function.

Example Replacement:

func (we WebAdapter) test(l *logs.Log, w http.ResponseWriter, req *http.Request) {
    ...

    // Removed
    // l.WarnAction(logutils.ActionUpdate, nil, err)
    l.WarnError(logutils.MessageActionError(logutils.ActionValidate, logutils.TypeQueryParam, nil), err)

    ...
}

Removed Functions:

  • Log.LogAction
  • Log.WarnAction
  • Log.ErrorAction
  • Log.LogData
  • Log.WarnData
  • Log.ErrorData

Log.SetHeaders

The Log.SetHeaders function has been renamed to Log.SetRequestHeaders and a new Log.SetResponseHeaders function has been added.

HttpRequestProperties

The HttpRequestProperties type has been renamed to HTTPRequestProperties. The related constructor functions have also been renamed:

  • NewAwsHealthCheckHttpRequestProperties → NewAwsHealthCheckHTTPRequestProperties
  • NewOpenShiftHealthCheckHttpRequestProperties → NewOpenShiftHealthCheckHTTPRequestProperties
  • NewStandardHealthCheckHttpRequestProperties → NewStandardHealthCheckHTTPRequestProperties

HttpResponse

The HttpResponse type has been renamed to HTTPResponse. The related constructor and log functions have also been renamed:

  • NewHttpResponse → NewHTTPResponse

  • NewErrorHttpResponse → NewErrorHTTPResponse

  • NewErrorJsonHttpResponse → NewJSONErrorHTTPResponse

  • SendHttpResponse → SendHTTPResponse

  • HttpResponseSuccess → HTTPResponseSuccess

  • HttpResponseSuccessMessage → HTTPResponseSuccessMessage

  • HttpResponseSuccessStatusMessage → HTTPResponseSuccessStatusMessage

  • HttpResponseSuccessJSON → HTTPResponseSuccessJSON

  • HttpResponseSuccessStatusJSON → HTTPResponseSuccessStatusJSON

  • HttpResponseSuccessBytes → HTTPResponseSuccessBytes

  • HttpResponseSuccessStatusBytes → HTTPResponseSuccessStatusBytes

  • HttpResponseError → HTTPResponseError

  • HttpResponseSuccessAction → HTTPResponseSuccessAction

  • HttpResponseSuccessStatusAction → HTTPResponseSuccessStatusAction

  • HttpResponseErrorAction → HTTPResponseErrorAction

  • HttpResponseErrorData → HTTPResponseErrorData

LoggerOpts.JsonFmt

The JsonFmt field in LoggerOpts has been renamed to JSONFmt.

v1.0.3

Choose a tag to compare

@shurwit shurwit released this 02 Dec 15:30
e57a457

Fixed

  • Error JSON encoding incorrect #9

Full Changelog: https://github.com/rokwire/logging-library-go/blob/main/CHANGELOG.md

v1.0.2

Choose a tag to compare

@shurwit shurwit released this 04 Nov 20:02
f93d0e0

Fixed

  • Error HTTP responses have wrong content type header #6
  • Fix bug on log levels #5

Full Changelog: https://github.com/rokwire/logging-library-go/blob/main/CHANGELOG.md

v1.0.1

Choose a tag to compare

@shurwit shurwit released this 04 Nov 18:21
4e2e428

Added

  • Add status to HTTP error responses #2

Full Changelog: https://github.com/rokwire/logging-library-go/blob/main/CHANGELOG.md

v1.0.0

Choose a tag to compare

@shurwit shurwit released this 12 Oct 20:16

Initial release