We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
type ProducerConfig struct { TotalSizeLnBytes int64 MaxIoWorkerCount int64 MaxBlockSec int MaxBatchSize int64 MaxBatchCount int LingerMs int64 Retries int MaxReservedAttempts int BaseRetryBackoffMs int64 MaxRetryBackoffMs int64 AdjustShargHash bool Buckets int AllowLogLevel string LogFileName string IsJsonType bool LogMaxSize int LogMaxBackups int LogCompress bool Endpoint string AccessKeyID string AccessKeySecret string NoRetryStatusCodeList []int UpdateStsToken func() (accessKeyID, accessKeySecret, securityToken string, expireTime time.Time, err error) StsTokenShutDown chan struct{} HTTPClient *http.Client UserAgent string NoLog bool } func logConfig(producerConfig *ProducerConfig) log.Logger { var logger log.Logger if producerConfig.LogFileName == "" { if producerConfig.IsJsonType { logger = log.NewJSONLogger(log.NewSyncWriter(os.Stdout)) } else { logger = log.NewLogfmtLogger(log.NewSyncWriter(os.Stdout)) } } else { if producerConfig.IsJsonType { logger = log.NewLogfmtLogger(initLogFlusher(producerConfig)) } else { logger = log.NewJSONLogger(initLogFlusher(producerConfig)) } } switch producerConfig.AllowLogLevel { case "debug": logger = level.NewFilter(logger, level.AllowDebug()) case "info": logger = level.NewFilter(logger, level.AllowInfo()) case "warn": logger = level.NewFilter(logger, level.AllowWarn()) case "error": logger = level.NewFilter(logger, level.AllowError()) default: logger = level.NewFilter(logger, level.AllowInfo()) } logger = log.With(logger, "time", log.DefaultTimestampUTC, "caller", log.DefaultCaller) if producerConfig.NoLog { logger = log.NewNopLogger() } return logger }
The text was updated successfully, but these errors were encountered:
Sorry 刚才回复错了,是你这边加的nolog,感谢建议,我们考虑下
Sorry, something went wrong.
不过这边我们的worker是个持续运行的过程,如果没有日志无法定位到具体的问题的
+1,希望支持传入logger
No branches or pull requests
The text was updated successfully, but these errors were encountered: