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

Logger should be interface type #63

Closed
ipfans opened this issue Sep 20, 2017 · 11 comments
Closed

Logger should be interface type #63

ipfans opened this issue Sep 20, 2017 · 11 comments

Comments

@ipfans
Copy link

ipfans commented Sep 20, 2017

Logger need more configurable with interface type. So it will be more suitable for common use.

Although we also used zap-logger in production, but we still want to spec log level or something details for logger for debug or others.

Logger Level can be:

type Logger interface{
    Named(s string) Logger
    Debug(msg string, fields ...interface{})
    Info(msg string, fields ...interface{})
    Warn(msg string, fields ...interface{})
    Error(msg string, fields ...interface{}) 
    Fatal(msg string, fields ...interface{})
}
@troian
Copy link
Member

troian commented Sep 20, 2017

@ipfans I didn't catch your thought. can you detail it please

@ipfans
Copy link
Author

ipfans commented Sep 21, 2017

Sorry for my pool english. @troian I updated code snippet to keep clearify.

I think ServerConfig or Server should export setter method of Logger interface to customize logger of volantmq. E.x., I want to redirect volantmq log to file or syslog.

Also I need set different level when I need debug transport and decode details.

@troian
Copy link
Member

troian commented Sep 21, 2017

Gotcha. Make sense

@ipfans
Copy link
Author

ipfans commented Sep 21, 2017

@troian another component persistence also can be interface type. It will be better than currnet implemention.

In default settings, all data store in memory without persistence. But developer can be change persistence backend by its own implemention(such as redis/influxdb/blotdb/postgresql etc.)

@troian
Copy link
Member

troian commented Sep 21, 2017

That will be a bit changed. Persistence gonna be plugin based and memory implementation set as default

@ipfans
Copy link
Author

ipfans commented Sep 21, 2017

Oh, I saw that metioned in #53 , but currently plugin system only works on Linux. So I think it shoud be discussed to make volantmq working on multi OS.

@troian
Copy link
Member

troian commented Sep 21, 2017

I think we start with hashicorp implementation. Should be multiplatform

@ipfans
Copy link
Author

ipfans commented Sep 21, 2017

Oh, this would be nice.

@ipfans
Copy link
Author

ipfans commented Sep 21, 2017

@troian I also have question about product positioning of VolantMQ. If VolantMQ will be a dependency server, there would be nice with plugins ecosystem to extend the ability of VolantMQ server. But as a MQTT library, I think plugin ecosystem enforce user to build/use embedded plugins, that not very friendly to developer.

@troian
Copy link
Member

troian commented Sep 21, 2017

As library VolantMQ has base which is enough to start i.e. it carries all of necessary API inside.
Plugins will be mostly for daemon but developers could use them as libraries as well.
For example BoltDB persistence can be imported into project which import VolantMQ as library

@ipfans
Copy link
Author

ipfans commented Sep 21, 2017

Gotcha. Thanks for your answer.

@troian troian closed this as completed Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants