Giter VIP home page Giter VIP logo

Comments (9)

Tochemey avatar Tochemey commented on May 23, 2024 1

@buraksezer I am using Olric to help build a clustered distributed system. This is the project https://github.com/Tochemey/goakt.

Basically I am using it as a distributed key/value stores

from olric.

Tochemey avatar Tochemey commented on May 23, 2024 1

@buraksezer Earlier on I was using etcd but when I discovered Olric with its sharding concept, I just jumped on it as my cluster engine

from olric.

Tochemey avatar Tochemey commented on May 23, 2024 1

@buraksezer closing the issue.

from olric.

Tochemey avatar Tochemey commented on May 23, 2024 1

@buraksezer this is how I got it working: Tochemey/goakt@f7bb961

from olric.

Tochemey avatar Tochemey commented on May 23, 2024

@buraksezer Thank you for monitoring this. I really do appreciate it. If you don't mind I can open a PR in that regard. Before then this is logging interface I am suggesting:

// Logger represents an active logging object that generates lines of
// output to an io.Writer.
type Logger interface {
	// Info starts a new message with info level.
	Info(...any)
	// Infof starts a new message with info level.
	Infof(string, ...any)
	// Warn starts a new message with warn level.
	Warn(...any)
	// Warnf starts a new message with warn level.
	Warnf(string, ...any)
	// Error starts a new message with error level.
	Error(...any)
	// Errorf starts a new message with error level.
	Errorf(string, ...any)
	// Fatal starts a new message with fatal level. The os.Exit(1) function
	// is called which terminates the program immediately.
	Fatal(...any)
	// Fatalf starts a new message with fatal level. The os.Exit(1) function
	// is called which terminates the program immediately.
	Fatalf(string, ...any)
	// Panic starts a new message with panic level. The panic() function
	// is called which stops the ordinary flow of a goroutine.
	Panic(...any)
	// Panicf starts a new message with panic level. The panic() function
	// is called which stops the ordinary flow of a goroutine.
	Panicf(string, ...any)
	// Debug starts a new message with debug level.
	Debug(...any)
	// Debugf starts a new message with debug level.
	Debugf(string, ...any)
	// LogOutput returns the log output that is set
	LogOutput() []io.Writer
	// StdLogger returns the standard logger associated to the logger
	StdLogger() *golog.Logger
	// WithContext returns the logger with the given context
	WithContext(ctx context.Context) Logger
}

where golog is an alias to the standard log. We can then add a default logger that implements such an interface.

from olric.

buraksezer avatar buraksezer commented on May 23, 2024

Hello @Tochemey,

This topic has been discussed before. You can find the previous issue here: #128 (comment)

Currently, the logging in Olric works like the following:

dm.s.log.V(3).Printf("[ERROR] Failed to synchronize replica %s: %v", version.host, err)

log is a flog instance. https://github.com/buraksezer/olric/blob/master/pkg/flog/flog.go

We might discuss a logging interface but the log format will not be changed. It's too costly and would be a waste of precious development time.

A hacky solution has been discussed here: #117. It's hacky but it definitely works.

If you don't mind I can open a PR in that regard.

Thank you for offering help but I only accept minor contributions.

from olric.

Tochemey avatar Tochemey commented on May 23, 2024

#128 (comment)

@buraksezer Thanks for the link.

from olric.

Tochemey avatar Tochemey commented on May 23, 2024

@buraksezer By the way, I cannot really see the solution from the list. Maybe I am not reading well. Currently my use case is to incorporate uber.zap

from olric.

buraksezer avatar buraksezer commented on May 23, 2024

The solution is passing a custom LogOutput implementation via the config struct. LogOutput is an io.Writer. A sample: #117 (comment)

loggerWriter implements io.Writer.

fluxninja/aperture uses the same approach. https://github.com/fluxninja/aperture/blob/main/pkg/dist-cache/logwriter.go

By the way, would you like to explain how you use Olric? What is your use case?

from olric.

Related Issues (20)

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.