Skip to content

Releases: vrecan/death

Release 3.0.3

27 Apr 18:43
Compare
Choose a tag to compare

This release fixes a bug in the go.mod file and will now allow importing death v3 in a go modules project without pinning to a direct commit hash.

Release 3.0.2

05 Jul 21:15
Compare
Choose a tag to compare
  • Remove vendor folder and move to go.mod
  • Remove dependency on seelog for tests
  • update dependencies
  • update go version to 1.14 in travis

Release 3.0.1

28 Jun 19:46
Compare
Choose a tag to compare

Fixes gopkg import bug where deathlog was importing from master in the versioned gopkg.in import. Now death exists in a single package for import.

Release 3.0

27 Jun 23:17
d901ecd
Compare
Choose a tag to compare

This release removes all external dependencies to a logger. Now by default death will not log anything but supports using your own custom logger. To use the logger satisfy the deathlog.Logger interface.

Also included with this release is the ability to check for errors from the closers being closed. If death fails to close all the closers, or if several closers return an error, the errors will be concatenated and bubbled up to the caller of death.WaitForDeath(closers...). See the example below:

func main() {
	death := DEATH.NewDeath(SYS.SIGINT, SYS.SIGTERM) //pass the signals you want to end your application
	objects := make([]io.Closer, 0)

	objects = append(objects, &NewType{}) // this will work as long as the type implements a Close method

	//when you want to block for shutdown signals
	err := death.WaitForDeath(objects...) // this will finish when a signal of your type is sent to your application
	if err != nil {
		log.Println(err)
		os.Exit(1)
	}
}

type NewType struct {
}

func (c *NewType) Close() error {
	return fmt.Errorf("an error")
}

Release 2.0

27 Mar 22:59
8f7e3ee
Compare
Choose a tag to compare

This release encompasses a compatibility change for integrating with logrus. Logrus and seelog are incompatible loggers so we need a new major version in order to use one or the other.

Specifically this Logger interface that seelog uses:

type Logger interface {
	Error(v ...interface{}) error
	Debug(v ...interface{})
	Info(v ...interface{})
	Warn(v ...interface{}) error
}

is incompatible with the interface that logrus uses:

type Logger interface {
	Error(v ...interface{})
	Debug(v ...interface{})
	Info(v ...interface{})
	Warn(v ...interface{})
}

As such we need to version death depending on the logger you are using.

With this release you should be importing Death using gopkg.in with the version you want. See the Readme for more details on how to import the different versions.

This also contains a quality of life fix for the builder pattern with SetTimeout and SetLogger. Both of those functions will now return the death object so you can chain function calls.

Release 1.0

27 Mar 21:52
a6a7840
Compare
Choose a tag to compare

This release is for backwards compatibility based on using a logger subscribing to the following interface:

type Logger interface {
	Error(v ...interface{}) error
	Debug(v ...interface{})
	Info(v ...interface{})
	Warn(v ...interface{}) error
}

A popular logging library you can plugin here is https://github.com/cihub/seelog.