Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.6.1 #3

Merged
merged 2 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .vscode/launch.json
Empty file.
35 changes: 35 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"[go]": {
"editor.codeActionsOnSave": {
},
"editor.defaultFormatter": "golang.go",
"editor.formatOnSave": true,
"editor.insertSpaces": false,
"editor.tabSize": 2,
},
"[ruby]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
},
"cmake.configureOnOpen": false,
"editor.detectIndentation": false,
"editor.insertSpaces": false,
"editor.renderWhitespace": "all",
"editor.rulers": [ 76 ],
"editor.tabSize": 2,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"go.formatFlags": [
],
"go.formatTool": "goimports",
"go.lintFlags": [
"--fast"
],
"go.lintOnSave": "workspace",
"go.lintTool": "golangci-lint",
"go.useLanguageServer": true,
"gopls": {
"ui.semanticTokens": true,
"ui.completion.usePlaceholders": true
},
}
23 changes: 23 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# **Diagnosticism.Go** Changes

## 0.6.1 - 22nd February 2025

* added **go.mod** and **go.sum**;
* refactored module version in terms of **ver2go**;
* added **examples/version.go** example;
* general reformatting with latest (1.24) version of Go;
* added VS Code settings;


## 0.6.0 - 23rd July 2020

* added `BackEnd`, `BackEndHandlerFunc` that allows `Log()` behaviour to be customised;
* added logging API tests;


## 0.5.0.1 - 22nd July 2020

* ~ renamed **examples/flog_fail.(go|md)** => **examples/logf_fail.(go|md)**
Expand All @@ -8,32 +23,40 @@

* ~ wholesale rename of ``diagnosticism`` => ``Diagnosticism``


## 0.4.0 (unchanged) - 8th July 2019

* + added several examples


## 0.4.0 - 8th July 2019

* + added LogHandler() adapter


## 0.3.2 - 4th June 2019

* ~ renamed ``AbortF()`` => ``Abortf()``, ``ConRepF()`` => ``ConRepf()``, ``LogF()`` => ``Logf()``


## 0.3.1 - 1st June 2019

* ~ fix to ``Log()``


## 0.3.0 - 1st June 2019

* + added ``ConRep()`` + ``ConRepF()`` and ``Abort()`` + ``AbortF()``


## 0.2.0 - 30th May 2019

* + added ``severity.Severity``
* + added ``Log()`` and ``LogF()``


## 0.1.0 - 28th March 2019

FIRST PUBLIC RELEASE


39 changes: 20 additions & 19 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
Diagnosticism.Go
BSD 3-Clause License - Diagnosticism.Go

Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems

Copyright (c) 2019-2020, Matthew Wilson
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the names of Diagnosticism or Diagnosticism.Go nor the names of the
copyright holder nor the names of its contributors may be used to endorse
or promote products derived from this software without specific prior
written permission.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Defect reports, feature requests, and pull requests are welcome on https://githu

### Dependencies

None
* [**ver2go**](https://github.com/synesissoftware/ver2go/)

### Dependent projects

Expand Down
20 changes: 8 additions & 12 deletions conrep.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* /////////////////////////////////////////////////////////////////////////
* File: conrep.go
* File: conrep.go
*
* Purpose: Contingent report API for Diagnosticism.Go
* Purpose: Contingent report API for Diagnosticism.Go
*
* Created: 31st May 2019
* Updated: 20th July 2020
* Created: 31st May 2019
* Updated: 22nd February 2025
*
* Home: https://github.com/synesissoftware/Diagnosticism.Go
* Home: https://github.com/synesissoftware/Diagnosticism.Go
*
* Copyright (c) 2019-2020, Matthew Wilson
* Copyright (c) 2019-2025, Matthew Wilson and Synesis Information Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -39,11 +39,9 @@
*
* ////////////////////////////////////////////////////////////////////// */


package diagnosticism

import (

severity "github.com/synesissoftware/Diagnosticism.Go/severity"

"fmt"
Expand All @@ -59,7 +57,7 @@ import (

var mirroringToLog bool

var contingentReportWriter io.Writer = os.Stderr
var contingentReportWriter io.Writer = os.Stderr

/* /////////////////////////////////////////////////////////////////////////
* helper functions
Expand Down Expand Up @@ -95,7 +93,7 @@ func getProgramName() string {

case ".exe":

base = base[0:len(base) - 4]
base = base[0 : len(base)-4]
}
}

Expand Down Expand Up @@ -168,5 +166,3 @@ func Abortf(format string, args ...interface{}) {
}

/* ///////////////////////////// end of file //////////////////////////// */


3 changes: 0 additions & 3 deletions examples/conrep.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

package main

import (

d "github.com/synesissoftware/Diagnosticism.Go"
)

Expand All @@ -13,4 +11,3 @@ func main() {

d.Abort("and we're out!")
}

3 changes: 0 additions & 3 deletions examples/conrep_with_log_mirroring.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

package main

import (

d "github.com/synesissoftware/Diagnosticism.Go"
)

Expand All @@ -17,4 +15,3 @@ func main() {

d.Abort("and we're out!")
}

10 changes: 3 additions & 7 deletions examples/logf_fail.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@

package main

import (

d "github.com/synesissoftware/Diagnosticism.Go"
severity "github.com/synesissoftware/Diagnosticism.Go/severity"
sev "github.com/synesissoftware/Diagnosticism.Go/severity"
)


func main() {

d.EnableLogging(true)

d.Logf(severity.Informational, "i=%d", 10)
d.Logf(sev.Informational, "i=%d", 10)

d.Logf(severity.Informational, "i=%d", "10")
d.Logf(sev.Informational, "i=%d", "10")
}

6 changes: 3 additions & 3 deletions examples/logf_fail.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ package main
import (

d "github.com/synesissoftware/Diagnosticism.Go"
severity "github.com/synesissoftware/Diagnosticism.Go/severity"
sev "github.com/synesissoftware/Diagnosticism.Go/severity"
)


func main() {

d.EnableLogging(true)

d.Logf(severity.Informational, "i=%d", 10)
d.Logf(sev.Informational, "i=%d", 10)

d.Logf(severity.Informational, "i=%d", "10")
d.Logf(sev.Informational, "i=%d", "10")
}
```

Expand Down
4 changes: 0 additions & 4 deletions examples/tracing.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@

package main

import (

d "github.com/synesissoftware/Diagnosticism.Go"
)


func SomeFunction(x, y int, order string) {
d.Trace("SomeFunction",
d.TrargNameOnly("x", x),
Expand All @@ -22,4 +19,3 @@ func main() {

SomeFunction(1, 2, "first")
}

10 changes: 10 additions & 0 deletions examples/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package main

import (
d "github.com/synesissoftware/Diagnosticism.Go"
)

func main() {

d.ConRepf("Diagnosticism v%v", d.VersionString())
}
28 changes: 28 additions & 0 deletions examples/version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Diagnosticism.Go Example - **tracing**

## Summary

Example illustrating use of Trace API.

## Source

```Go
package main

import (
d "github.com/synesissoftware/Diagnosticism.Go"
)

func main() {

d.ConRepf("Diagnosticism v%v", d.VersionString())
}
```

## Execution

When executed, it gives output (to the standard error stream) along the lines of

```
Diagnosticism v0.6.1
```
15 changes: 15 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module github.com/synesissoftware/Diagnosticism.Go

go 1.23.6

require (
github.com/stretchr/testify v1.10.0
github.com/synesissoftware/STEGoL v0.0.0-20190330001846-560e2a134da1
github.com/synesissoftware/ver2go v0.0.0-20250213011429-1fbcb230c744
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
13 changes: 13 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/synesissoftware/STEGoL v0.0.0-20190330001846-560e2a134da1 h1:gjzrJrWmidiPhErkIA/lm2fBiGXVNF/UWzY53eebRUg=
github.com/synesissoftware/STEGoL v0.0.0-20190330001846-560e2a134da1/go.mod h1:fLXaHg0WlvcjPSX669XZWm+FNyU6ezvGoEWmWSc6I8A=
github.com/synesissoftware/ver2go v0.0.0-20250213011429-1fbcb230c744 h1:/+nOiKrcuGd+oi/81p47CKtA3Q+Ct4YseOIMfKHcpsQ=
github.com/synesissoftware/ver2go v0.0.0-20250213011429-1fbcb230c744/go.mod h1:ZvENMYQ3mjb9e5ymZL5OyQAa56ckYVTvAvycvYg8Vlw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Loading