Corregido el packer y cambiado el nombre del interface de Builder a PackBuilder.

master
DEV 2 years ago
parent 6a2fd4b457
commit 8bc338992b

@ -35,11 +35,11 @@ import (
const ( const (
errFieldCoreName string = "core-name" errFieldLogger string = "logger"
errScopeCoreName string = "scope-name" errFieldScope string = "scope"
entryFieldCoreName string = "logger-core" entryFieldLogger string = "logger"
LevelNameData string = "DATA" LevelNameData string = "DATA"
@ -73,10 +73,10 @@ var (
ScopeSep byte ScopeSep byte
ScopeNameTransforms astrings.Transformers ScopeNameTransforms astrings.Transformers
FmtMsgLogLogErr string FmtMsgLogErr string
FmtMsgLogStartErr string FmtMsgStartErr string
FmtMsgLogStopErr string FmtMsgStopErr string
FmtMsgLogFlushErr string FmtMsgFlushErr string
}{ }{
ErrInvalidLevel : errs.ErrCode("invalid-level"), ErrInvalidLevel : errs.ErrCode("invalid-level"),
@ -91,10 +91,10 @@ var (
ScopeSep : '.', ScopeSep : '.',
ScopeNameTransforms : astrings.MakeTransformers("lower"), ScopeNameTransforms : astrings.MakeTransformers("lower"),
FmtMsgLogLogErr : "Error logging logger %s", FmtMsgLogErr : "Error logging logger %s",
FmtMsgLogStartErr : "Error starting logger %s", FmtMsgStartErr : "Error starting logger %s",
FmtMsgLogStopErr : "Error stopping logger %s", FmtMsgStopErr : "Error stopping logger %s",
FmtMsgLogFlushErr : "Error flushing logger %s", FmtMsgFlushErr : "Error flushing logger %s",
} }

@ -1,39 +0,0 @@
// ------------------------------------------------------------------------
// Project active2
// Active Thing (activething.com) git.activething.com/go
//
// File name entry_logger.go
// Created by DEV
// Modified 24/04/2024
//
// Copyright 2024 activething.com
// ------------------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package alogs
type (
EntryLogger interface {
Name () string
Start () error
Stop () error
Flush () error
Log (entry *Entry) error
}
)

@ -1,35 +0,0 @@
// ------------------------------------------------------------------------
// Project active2
// Active Thing (activething.com) git.activething.com/go
//
// File name loggable.go
// Created by DEV
// Modified 24/04/2024
//
// Copyright 2024 activething.com
// ------------------------------------------------------------------------
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ------------------------------------------------------------------------
package alogs
type (
Loggable interface {
Log (ent *Entry) error
}
)

@ -28,15 +28,14 @@ type (
Logger interface { Logger interface {
Name () string Name () string
Level() Level Level () Level
Fatal(message string, err error, options ...EntryFnc) Start () error
Error(message string, err error, options ...EntryFnc) Stop () error
Warn (message string, options ...EntryFnc) Flush () error
Info (message string, options ...EntryFnc)
Debug(message string, options ...EntryFnc) Log (entry *Entry) error
Data (message string, data any, options ...EntryFnc)
} }
) )

@ -25,6 +25,7 @@ package alogs
import ( import (
"errs" "errs"
"fmt"
"iosys" "iosys"
"sync" "sync"
) )
@ -181,7 +182,6 @@ func (l *LoggerCore) Data (msg string, data any, ops ...EntryFnc){
func (l *LoggerCore) log(level Level, msg string, err error, options ...EntryFnc) { func (l *LoggerCore) log(level Level, msg string, err error, options ...EntryFnc) {
l.Lock() l.Lock()
if l.state != StateStarted { if l.state != StateStarted {
l.handleError(G.ErrLoggerNotStarted,nil)
l.Unlock() l.Unlock()
return return
} }
@ -190,6 +190,7 @@ func (l *LoggerCore) log(level Level, msg string, err error, options ...EntryFnc
return return
} }
en := l.extenders.ExtendEntry(AcquireEntry(l,level,msg,err,options...)) en := l.extenders.ExtendEntry(AcquireEntry(l,level,msg,err,options...))
if er := l.appender.AppendEntry(en); er != nil { if er := l.appender.AppendEntry(en); er != nil {
l.handleError(er,en) l.handleError(er,en)
@ -214,6 +215,7 @@ func (l *LoggerCore) Log(entry *Entry) error {
l.Unlock() l.Unlock()
return nil return nil
} }
fmt.Printf("--> Llalmando al logger %s con la entrada logger %v\n",l.name,entry.Excludes)
er := l.appender.AppendEntry(entry) er := l.appender.AppendEntry(entry)
l.Unlock() l.Unlock()
return er return er

@ -43,7 +43,10 @@ type (
queue queue.GQueue[*Entry] queue queue.GQueue[*Entry]
scopes loggerScopes scopes loggerScopes
loggers []EntryLogger loggers []Logger
async bool
chanLog chan *Entry
level Level level Level
name string name string
@ -84,6 +87,7 @@ func NewLoggerManager(name string, level Level, options ...LoggerManagerFnc) *Lo
func (l *LoggerManager) Name() string { func (l *LoggerManager) Name() string {
return l.name } return l.name }
func (l *LoggerManager) Level() Level { func (l *LoggerManager) Level() Level {
l.RLock() l.RLock()
lv := l.level lv := l.level
@ -91,6 +95,7 @@ func (l *LoggerManager) Level() Level {
return lv return lv
} }
func (l *LoggerManager) SetLevel (level Level) { func (l *LoggerManager) SetLevel (level Level) {
l.Lock() l.Lock()
l.level = level l.level = level
@ -101,6 +106,7 @@ func (l *LoggerManager) SetLevel (level Level) {
func (l *LoggerManager) Count () int64 { func (l *LoggerManager) Count () int64 {
return atomic.LoadInt64(&l.count) } return atomic.LoadInt64(&l.count) }
func (l *LoggerManager) incCount () { func (l *LoggerManager) incCount () {
atomic.AddInt64(&l.count,1) } atomic.AddInt64(&l.count,1) }
@ -118,11 +124,10 @@ func (l *LoggerManager) Errors () errs.ErrorList {
ls := l.errors ls := l.errors
l.RUnlock() l.RUnlock()
return ls return ls
} }
func (l *LoggerManager) Start (all bool) error { func (l *LoggerManager) Start () error {
l.Lock() l.Lock()
if l.state == StateStarted { if l.state == StateStarted {
l.Unlock() l.Unlock()
@ -133,43 +138,50 @@ func (l *LoggerManager) Start (all bool) error {
} }
l.state = StateStarted l.state = StateStarted
if !all { er := l.handleLoggers(nil,func(c Logger, _ *Entry) error { return c.Start() }, G.FmtMsgStartErr,)
l.Unlock() if er != nil {
return nil l.handleQueue()
} }
return l.doLoggers(nil,func(c EntryLogger, _ *Entry) error { return c.Start() }, G.FmtMsgLogStartErr,true) l.Unlock()
return er
} }
func (l *LoggerManager) Stop (all bool) error { func (l *LoggerManager) Stop () error {
l.Lock() l.Lock()
if l.state != StateStarted { if l.state != StateStarted {
l.Unlock() l.Unlock()
return G.ErrLoggerNotStarted return G.ErrLoggerNotStarted
} }
l.state = StateStopped l.state = StateStopped
if !all { er := l.handleLoggers(nil,func(c Logger, _ *Entry) error { return c.Stop() }, G.FmtMsgStopErr)
l.Unlock() if er != nil {
return nil l.handleQueue()
} }
return l.doLoggers(nil,func(c EntryLogger, _ *Entry) error { return c.Stop() }, G.FmtMsgLogStopErr,true) l.Unlock()
return er
} }
func (l *LoggerManager) Flush () error { func (l *LoggerManager) Flush () error {
l.Lock() l.Lock()
return l.doLoggers(nil,func(c EntryLogger,_ *Entry) error { return c.Flush() }, G.FmtMsgLogFlushErr,true)
}
er := l.handleLoggers(nil,func(c Logger,_ *Entry) error { return c.Flush() }, G.FmtMsgFlushErr)
if er != nil {
l.handleQueue()
}
l.Unlock()
return er
}
func (l *LoggerManager) GetLogger(name string) EntryLogger { func (l *LoggerManager) GetLogger(name string) Logger {
l.RLock() l.RLock()
var co EntryLogger var co Logger
if p := l.findLogger(name); p != -1 { if p := l.findLogger(name); p != -1 {
co = l.loggers[p] co = l.loggers[p]
} }
@ -177,12 +189,13 @@ func (l *LoggerManager) GetLogger(name string) EntryLogger {
return co return co
} }
func (l *LoggerManager) AddCore (logger EntryLogger) error {
func (l *LoggerManager) AddLogger(logger Logger) error {
l.Lock() l.Lock()
nm := logger.Name() nm := logger.Name()
if p := l.findLogger(nm); p != -1 { if p := l.findLogger(nm); p != -1 {
l.Unlock() l.Unlock()
return G.ErrDuplicatedLogger.WrapWithFieldString(errFieldCoreName,nm) return G.ErrDuplicatedLogger.WrapWithFieldString(errFieldLogger,nm)
} }
var er error var er error
l.loggers = append(l.loggers,logger) l.loggers = append(l.loggers,logger)
@ -193,12 +206,13 @@ func (l *LoggerManager) AddCore (logger EntryLogger) error {
return er return er
} }
func (l *LoggerManager) DelCore (name string) error {
func (l *LoggerManager) DelLogger(name string) error {
l.Lock() l.Lock()
p := l.findLogger(name) p := l.findLogger(name)
if p != -1 { if p != -1 {
l.Unlock() l.Unlock()
return G.ErrNotExistsLogger.WrapWithFieldString(entryFieldCoreName,name) return G.ErrNotExistsLogger.WrapWithFieldString(entryFieldLogger,name)
} }
er := l.loggers[p].Stop() er := l.loggers[p].Stop()
l.loggers = append(l.loggers[:p],l.loggers[p+1:]...) l.loggers = append(l.loggers[:p],l.loggers[p+1:]...)
@ -208,10 +222,8 @@ func (l *LoggerManager) DelCore (name string) error {
} }
func (l *LoggerManager) GetScope(name string) *LoggerScope { func (l *LoggerManager) GetScope(name string) *LoggerScope {
ns := strings.Split(G.ScopeNameTransforms.Transform(name),g.scopeSepStr) ns := strings.Split(G.ScopeNameTransforms.Transform(name),g.scopeSepStr)
l.RLock() l.RLock()
sc := l.scopes.getScope(ns[0]) sc := l.scopes.getScope(ns[0])
if sc != nil && len(ns) > 1 { if sc != nil && len(ns) > 1 {
@ -221,6 +233,7 @@ func (l *LoggerManager) GetScope(name string) *LoggerScope {
return sc return sc
} }
func (l *LoggerManager) AddScope(name string, options ...LoggerScopeFnc) (*LoggerScope,error) { func (l *LoggerManager) AddScope(name string, options ...LoggerScopeFnc) (*LoggerScope,error) {
nm := G.ScopeNameTransforms.Transform(name) nm := G.ScopeNameTransforms.Transform(name)
ns := strings.Split(nm,g.scopeSepStr) ns := strings.Split(nm,g.scopeSepStr)
@ -236,7 +249,7 @@ func (l *LoggerManager) AddScope(name string, options ...LoggerScopeFnc) (*Logge
} }
} else if len(ns) == 1 { } else if len(ns) == 1 {
l.Unlock() l.Unlock()
return nil,G.ErrDuplicatedScope.WrapWithFieldString(errScopeCoreName,ns[0]) return nil,G.ErrDuplicatedScope.WrapWithFieldString(errFieldScope,ns[0])
} }
l.Unlock() l.Unlock()
@ -244,82 +257,84 @@ func (l *LoggerManager) AddScope(name string, options ...LoggerScopeFnc) (*Logge
} }
func (l *LoggerManager) Fatal(msg string, err error, ops ...EntryFnc){
func (l *LoggerManager) Fatal (msg string, err error, ops ...EntryFnc){
l.log(LevelFatal,msg,err,ops) } l.log(LevelFatal,msg,err,ops) }
func (l *LoggerManager) Error(msg string, err error, ops ...EntryFnc){
func (l *LoggerManager) Error (msg string, err error, ops ...EntryFnc){
l.log(LevelError,msg,err,ops) } l.log(LevelError,msg,err,ops) }
func (l *LoggerManager) Warn (msg string, ops ...EntryFnc){
func (l *LoggerManager) Warn (msg string, ops ...EntryFnc){
l.log(LevelWarn,msg,nil,ops) } l.log(LevelWarn,msg,nil,ops) }
func (l *LoggerManager) Info (msg string, ops ...EntryFnc){
func (l *LoggerManager) Info (msg string, ops ...EntryFnc){
l.log(LevelInfo,msg,nil,ops) } l.log(LevelInfo,msg,nil,ops) }
func (l *LoggerManager) Debug(msg string, ops ...EntryFnc){
func (l *LoggerManager) Debug (msg string, ops ...EntryFnc){
l.log(LevelDebug,msg,nil,ops) } l.log(LevelDebug,msg,nil,ops) }
func (l *LoggerManager) Data (msg string, data any, ops ...EntryFnc){
func (l *LoggerManager) Data (msg string, data any, ops ...EntryFnc){
l.log(LevelData,msg,nil,[]EntryFnc{EntryWithData(data,ops...)}) } l.log(LevelData,msg,nil,[]EntryFnc{EntryWithData(data,ops...)}) }
func (l *LoggerManager) Log (entry *Entry) error { func (l *LoggerManager) Log (entry *Entry) error {
if entry == nil { if entry == nil {
return nil return nil
} }
l.Lock() l.Lock()
if l.state != StateStarted { if l.state != StateStarted {
l.Unlock() l.Unlock()
return G.ErrLoggerNotStarted return G.ErrLoggerNotStarted
} }
if !l.level.Has(entry.Level) || !l.filters.Filter(entry) { if !l.level.Has(entry.Level) {
l.Unlock() l.Unlock()
return nil return nil
} }
if entry.Logger == nil {
//viene de un scope er := l.logEntry(entry,false)
entry.Logger = l if er != nil {
l.extenders.ExtendEntry(entry) l.handleQueue()
} }
return l.doLoggers(entry,func(c EntryLogger, e *Entry) error { return c.Log(e) },G.FmtMsgLogLogErr,false) l.Unlock()
return er
} }
func (l *LoggerManager) log (level Level, msg string, err error,options []EntryFnc) { func (l *LoggerManager) log (level Level, msg string, err error,options []EntryFnc) {
l.Lock() l.Lock()
if l.state != StateStarted || !l.level.Has(level){ if l.state != StateStarted || !l.level.Has(level){
l.Unlock() l.Unlock()
return return
} }
l.incCount() er := l.logEntry(AcquireEntry(l,level,msg,err,options...),true)
en := AcquireEntry(l,level,msg,err,options...) if er != nil {
_ = l.doLoggers(en,func(c EntryLogger, e *Entry) error { return c.Log(e) },G.FmtMsgLogLogErr,true) l.handleQueue()
if level == LevelFatal && l.onFatalFn != nil {
l.onFatalFn(l,en)
} }
ReleaseEntry(en)
}
l.Unlock()
return
func (l *LoggerManager) handleEntry (entry *Entry, self bool) error { }
if self || entry.Logger == nil { func (l *LoggerManager) logEntry(entry *Entry, self bool) error {
l.extenders.ExtendEntry(entry) if !l.filters.Filter(entry) {
if entry.Logger == nil { return nil
entry.Logger = l
}
} }
if self {
l.incCount()
} else if entry.Logger == nil {
entry.Logger = l
}
l.extenders.ExtendEntry(entry)
er := l.handleLoggers(entry,func(c Logger, e *Entry) error { return c.Log(e) },G.FmtMsgLogErr)
if self { if self {
if entry.Level == LevelFatal && l.onFatalFn != nil { if entry.Level == LevelFatal && l.onFatalFn != nil {
l.onFatalFn(l, entry) l.onFatalFn(l, entry)
@ -327,7 +342,7 @@ func (l *LoggerManager) handleEntry (entry *Entry, self bool) error {
ReleaseEntry(entry) ReleaseEntry(entry)
} }
return nil return er
} }
@ -335,7 +350,7 @@ func (l *LoggerManager) handleError (err error, entry *Entry) {
if err == nil { if err == nil {
return return
} }
l.Lock()
l.errors = l.errors.Append(err) l.errors = l.errors.Append(err)
if l.logErrors { if l.logErrors {
if entry == nil { if entry == nil {
@ -343,7 +358,6 @@ func (l *LoggerManager) handleError (err error, entry *Entry) {
} }
l.queue.Push(entry) l.queue.Push(entry)
} }
l.Unlock()
if l.onErrorFn != nil { if l.onErrorFn != nil {
l.onErrorFn(l,err) l.onErrorFn(l,err)
@ -351,17 +365,15 @@ func (l *LoggerManager) handleError (err error, entry *Entry) {
} }
func (l *LoggerManager) handleQueue() {
func (l *LoggerManager) enqueue() {
for en := l.queue.Pop(); en != nil; { for en := l.queue.Pop(); en != nil; {
_ = l.doLoggers(en,func(c EntryLogger, e *Entry) error { return c.Log(e) },G.FmtMsgLogLogErr,true) _ = l.logEntry(en,true)
ReleaseEntry(en) en = l.queue.Pop()
} }
} }
func (l *LoggerManager) doLoggers(entry *Entry, doFn func(c EntryLogger, e *Entry) error, msg string, unlock bool) error { func (l *LoggerManager) handleLoggers(entry *Entry, doFn func(c Logger, e *Entry) error, msg string) error {
var el errs.ErrorList var el errs.ErrorList
for _,co := range l.loggers { for _,co := range l.loggers {
@ -374,14 +386,12 @@ func (l *LoggerManager) doLoggers(entry *Entry, doFn func(c EntryLogger, e *Entr
en = AcquireEntry(l,LevelError,ms,ne, en = AcquireEntry(l,LevelError,ms,ne,
EntryWithExtender(l.extenders), EntryWithExtender(l.extenders),
EntryWithExclude (nm), EntryWithExclude (nm),
EntryWithField (entryFieldCoreName,nm,true)) EntryWithField (entryFieldLogger,nm,true))
} }
l.handleError(er,en) l.handleError(er,en)
} }
} }
if unlock {
l.Unlock()
}
return errs.NewErrMultiIf(el) return errs.NewErrMultiIf(el)
} }
@ -396,6 +406,16 @@ func (l *LoggerManager) findLogger(name string) int {
} }
func (l *LoggerManager) runLogger () {
for {
select {
case e := <- l.chanLog :
//todo
}
}
}
func LoggerManagerWithFilters (configFilters EntryFiltersFnc) LoggerManagerFnc { func LoggerManagerWithFilters (configFilters EntryFiltersFnc) LoggerManagerFnc {
return func(a *LoggerManager) { return func(a *LoggerManager) {
configFilters(&a.filters) } } configFilters(&a.filters) } }

@ -43,7 +43,7 @@ type (
nodes [][]byte nodes [][]byte
mode ScopeMode mode ScopeMode
parent Loggable parent Logger
scopes loggerScopes scopes loggerScopes
} }
@ -52,7 +52,7 @@ type (
) )
func newLoggerScope (name string, level Level, parent Loggable, path string, nodes [][]byte, options []LoggerScopeFnc) *LoggerScope { func newLoggerScope (name string, level Level, parent Logger, path string, nodes [][]byte, options []LoggerScopeFnc) *LoggerScope {
if path != "" { if path != "" {
path = fmt.Sprintf("%s%c%s",path,G.ScopeSep,name) path = fmt.Sprintf("%s%c%s",path,G.ScopeSep,name)
} else { } else {
@ -112,6 +112,14 @@ func (l *LoggerScope) SetMode (mode ScopeMode) {
l.Unlock() l.Unlock()
} }
// Start Debe de implementarse para que cumpla con el interface Logger
func (_ *LoggerScope)Start () error { return nil }
// Stop Debe de implementarse para que cumpla con el interface Logger
func (_ *LoggerScope)Stop () error { return nil }
// Flush Debe de implementarse para que cumpla con el interface Logger
func (_ *LoggerScope)Flush () error { return nil }
func (l *LoggerScope) GetScope (name string) *LoggerScope { func (l *LoggerScope) GetScope (name string) *LoggerScope {
return l.getScope(strings.Split(strings.ToLower(name),g.scopeSepStr)) } return l.getScope(strings.Split(strings.ToLower(name),g.scopeSepStr)) }
@ -141,7 +149,7 @@ func (l *LoggerScope) newScope (path []string, options []LoggerScopeFnc) (sc *Lo
} }
} else if len(path) == 1 { } else if len(path) == 1 {
l.Unlock() l.Unlock()
return nil,G.ErrDuplicatedScope.WrapWithFieldString(errScopeCoreName,path[0]) return nil,G.ErrDuplicatedScope.WrapWithFieldString(errFieldScope,path[0])
} }
sc,er = sc.newScope(path[1:],options) sc,er = sc.newScope(path[1:],options)
l.Unlock() l.Unlock()
@ -149,26 +157,22 @@ func (l *LoggerScope) newScope (path []string, options []LoggerScopeFnc) (sc *Lo
} }
func (l *LoggerScope) Fatal (msg string, err error, ops ...EntryFnc){ func (l *LoggerScope) Fatal (msg string, err error, ops ...EntryFnc){
l.log(LevelFatal,msg,err,ops ...) } l.log(LevelFatal,msg,err,ops ...) }
func (l *LoggerScope) Error (msg string, err error, ops ...EntryFnc){ func (l *LoggerScope) Error (msg string, err error, ops ...EntryFnc){
l.log(LevelError,msg,err,ops ...) } l.log(LevelError,msg,err,ops ...) }
func (l *LoggerScope) Warn (msg string, ops ...EntryFnc){ func (l *LoggerScope) Warn (msg string, ops ...EntryFnc){
l.log(LevelWarn,msg,nil,ops ...) } l.log(LevelWarn,msg,nil,ops ...) }
func (l *LoggerScope) Info (msg string, ops ...EntryFnc){ func (l *LoggerScope) Info (msg string, ops ...EntryFnc){
l.log(LevelInfo,msg,nil,ops...) } l.log(LevelInfo,msg,nil,ops...) }
func (l *LoggerScope) Debug (msg string, ops ...EntryFnc){ func (l *LoggerScope) Debug (msg string, ops ...EntryFnc){
l.log(LevelDebug,msg,nil,ops...) } l.log(LevelDebug,msg,nil,ops...) }
func (l *LoggerScope) Data (msg string, data any, ops ...EntryFnc){ func (l *LoggerScope) Data (msg string, data any, ops ...EntryFnc){
l.log(LevelData,msg,nil,EntryWithData(data,ops...)) } l.log(LevelData,msg,nil,EntryWithData(data,ops...)) }

@ -28,16 +28,24 @@ func Append (entry *alogs.Entry) error {
} }
func Append2 (_ *alogs.Entry) error {
return errs.NewErrMessage(errs.ErrCode("UnError"),"Esto es el mensaje del error")
}
func main() { func main() {
l := alogs.NewLoggerManager("Main",alogs.LevelAll) l := alogs.NewLoggerManager("Main",alogs.LevelAll)
l.AddCore(alogs.NewLoggerCore("MiLogger",alogs.LevelAll,alogs.LoggerCoreWithAppender(alogs.AppendEntryFnc(Append)))) l.AddLogger(alogs.NewLoggerCore("MiLogger",alogs.LevelAll,alogs.LoggerCoreWithAppender(alogs.AppendEntryFnc(Append))))
l.Start(true) l.AddLogger(alogs.NewLoggerCore("LoggerProblematico",alogs.LevelAll,alogs.LoggerCoreWithAppender(alogs.AppendEntryFnc(Append2))))
l.Start()
l.Warn("Esto es un mensage") l.Warn("Esto es un mensage")
l.Error("Esto es un mensage",errs.ErrCode("UnError")) //l.Error("Esto es un mensage",errs.ErrCode("UnError"))
l.Fatal("Fatalidad",errs.NewErrPanic(errs.ErrCode("unca cauisa"))) //l.Fatal("Fatalidad",errs.NewErrPanic(errs.ErrCode("unca cauisa")))

Loading…
Cancel
Save

Powered by TurnKey Linux.