88
99// LogRequestStart logs the initiation of an HTTP request if the current log level permits.
1010func (d * defaultLogger ) LogRequestStart (requestID string , userID string , method string , url string , headers map [string ][]string ) {
11- if d .logLevel <= LogLevelInfo { // Assuming LogLevelInfo is appropriate for request start messages.
11+ if d .logLevel <= LogLevelInfo {
1212 fields := []zap.Field {
1313 zap .String ("event" , "request_start" ),
1414 zap .String ("method" , method ),
@@ -23,7 +23,7 @@ func (d *defaultLogger) LogRequestStart(requestID string, userID string, method
2323
2424// LogRequestEnd logs the completion of an HTTP request if the current log level permits.
2525func (d * defaultLogger ) LogRequestEnd (method string , url string , statusCode int , duration time.Duration ) {
26- if d .logLevel <= LogLevelInfo { // Assuming LogLevelInfo is appropriate for request end messages.
26+ if d .logLevel <= LogLevelInfo {
2727 fields := []zap.Field {
2828 zap .String ("event" , "request_end" ),
2929 zap .String ("method" , method ),
@@ -52,7 +52,7 @@ func (d *defaultLogger) LogError(method string, url string, statusCode int, err
5252
5353// LogRetryAttempt logs a retry attempt for an HTTP request if the current log level permits, including wait duration and the error that triggered the retry.
5454func (d * defaultLogger ) LogRetryAttempt (method string , url string , attempt int , reason string , waitDuration time.Duration , err error ) {
55- if d .logLevel <= LogLevelWarn { // Assuming LogLevelWarn is appropriate for retry attempt messages.
55+ if d .logLevel <= LogLevelWarn {
5656 fields := []zap.Field {
5757 zap .String ("event" , "retry_attempt" ),
5858 zap .String ("method" , method ),
@@ -68,7 +68,7 @@ func (d *defaultLogger) LogRetryAttempt(method string, url string, attempt int,
6868
6969// LogRateLimiting logs when an HTTP request is rate-limited, including the HTTP method, URL, the value of the 'Retry-After' header, and the actual wait duration.
7070func (d * defaultLogger ) LogRateLimiting (method string , url string , retryAfter string , waitDuration time.Duration ) {
71- if d .logLevel <= LogLevelWarn { // Check if the log level permits warning messages.
71+ if d .logLevel <= LogLevelWarn {
7272 fields := []zap.Field {
7373 zap .String ("event" , "rate_limited" ),
7474 zap .String ("method" , method ),
0 commit comments