# README
Logger
This logger basically configure zerolog so that you can log via github.com/rs/zerolog/log
Usage
Import shared/logger
package. It will be self-initialized.
import "github.com/xmlking/grpc-starter-kit/internal/logger"
Once logger is initialized, then you can use standard github.com/rs/zerolog/log
package's helper methods to log in your code.
Environment Variables
Your can set Logger config via Environment Variables
grpc internal logs also adopt
CONFIG_LOG_LEVEL
andCONFIG_LOG_FORMAT
No need to set
GRPC_GO_LOG_SEVERITY_LEVEL
andGRPC_GO_LOG_VERBOSITY_LEVEL
CONFIG_LOG_LEVEL=<trace,debug,info,warn,error,fatal,panic>
CONFIG_LOG_FORMAT=<pretty/json/gcp>
Test
CONFIG_LOG_LEVEL=info CONFIG_LOG_FORMAT=json go test github.com/xmlking/grpc-starter-kit/internal/logger -count=1
# Functions
Helper functions on DefaultLogger.
No description provided by the author
No description provided by the author
ReportCaller set value to `true`.
No description provided by the author
WithFields set default fields for the logger.
WithFormat set default log format for the logger.
WithLevel set default level for the logger.
WithOutput set default output writer for the logger.
WithTimeFormat set default timeFormat for the logger.
# Variables
Default Logger.
# Interfaces
No description provided by the author