Able to change logger's prefix and output after configuration

This commit is contained in:
Gerasimos Maropoulos 2016-09-30 14:02:03 +03:00
parent c2144a83c6
commit 5e7975d97f

View File

@ -293,6 +293,10 @@ func Build() {
// SERVE IRIS BEHIND AN EXTERNAL CUSTOM fasthttp.Server, CAN BE CALLED ONCE PER IRIS INSTANCE FOR YOUR SAFETY
func (s *Framework) Build() {
s.once.Do(func() {
// re-nwe logger's attrs
s.Logger.SetPrefix(s.Config.LoggerPreffix)
s.Logger.SetOutput(s.Config.LoggerOut)
// prepare the serializers, if not any other serializers setted for the default serializer types(json,jsonp,xml,markdown,text,data) then the defaults are setted:
serializer.RegisterDefaults(s.serializers)