Skip to content

The zap_mate is a packaging toolkit of zap. It combines zap, viper, lumberjack and many other tools to integrate it, making zap configuration lighter, more convenient and faster, so as to better assist developers.

License

big-uncle/zap_mate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zap_mate

The zap_mate is a simple packaging tools of zap. It combines zap, viper, lumberjack and many other tools to integrate it, making zap configuration lighter, more convenient and faster, so as to better assist developers.

See the example folder for more details ...

Usage

Use the origin ZAP logger

  • Example
    logger := zap_mate.NewZapLogger("../test.yaml", "default")
    
    logger.Debug("Hi, boy!")
    
    logger.Info("I am zap_mate!")

Use the mate logger

If you want to use mate logger:

The mate logger supports async and sync write logs, and extends all feature of origin zap.

  • Example
    logger := zap_mate.NewZapMateLogger("../test.yaml", "default")
    
    logger.SetAsyncer(10)
    
    logger.AsyncDebug("Hi, boy!")
    
    logger.AsyncInfo("I am zap_mate!")
    
    logger.Info("oh oh oh")
    
    logger.Flush()
    
    logger.Warn("I am a logger of zap_mate")
    
    sugar := logger.Sugar()
    
    sugar.Error("I am Sugar!")

    Note: Child node cannot affect parent nodes,but child node all feature of extends parent node!

About

The zap_mate is a packaging toolkit of zap. It combines zap, viper, lumberjack and many other tools to integrate it, making zap configuration lighter, more convenient and faster, so as to better assist developers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages