Giter Site home page Giter Site logo

slog's People

Contributors

amery avatar karasz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

zhanglei

slog's Issues

tests

$ make test
▶ generating subproject rules
▶ test: root
?       github.com/darvaza-proxy/slog   [no test files]
?       github.com/darvaza-proxy/slog/internal  [no test files]
▶ test: logrus
?       github.com/darvaza-proxy/slog/logrus    [no test files]
▶ test: zap
?       github.com/darvaza-proxy/slog/zap       [no test files]
▶ test: zerolog
?       github.com/darvaza-proxy/slog/zerolog   [no test files]
▶ test: cblog
?       github.com/darvaza-proxy/slog/cblog     [no test files]

we need to find a way to test implementation and compliance of each adaptor we implement. currently reduced to zerolog and cblog, but also the *log.Logger writer at the top level and the internal/ helpers

zerolog: Fatal() and Panic() continue

The following, using zlog.Fatal() or zlog.Panic() ends before the unreachable mark

package main

import (
	"os"

	"github.com/rs/zerolog"
)

func main() {
	zlog := zerolog.New(zerolog.ConsoleWriter{
		Out: os.Stderr,
	})
	zlog.Fatal().Msg("Fatal")
	panic("unreachable")
}
�[90m<nil>�[0m �[1m�[31mFTL�[0m�[0m Fatal

Program exited.

but when using our wrapper, it doesn't.

package main

import (
	"os"

	slog "github.com/darvaza-proxy/slog/handlers/zerolog"
	"github.com/rs/zerolog"
)

func main() {
	zlog := zerolog.New(zerolog.ConsoleWriter{
		Out: os.Stderr,
	})
	log := slog.New(&zlog)
	log.Fatal().Print("Fatal")
	panic("unreachable")
}
�[90m<nil>�[0m �[1m�[31mFTL�[0m�[0m Fatal
panic: unreachable

goroutine 1 [running]:
main.main()
	/tmp/sandbox1363277814/prog.go:18 +0x15b

Program exited.

Log back-end location

I was thinking if we should not have a backends folder for the log backends. Having them all in root seems a bit messy.
Something like

mkdir -p backends
git mv zerolog backends/zerolog

It will make #12 a bit easier to implement.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.