gophercloud / utils

Apache License 2.0
20 stars 55 forks source link

Debug: split log method into request and response logs #117

Open kayrus opened 4 years ago

kayrus commented 4 years ago

@jtopjian I propose the following interface for the debug client:

// Logger is an interface representing the Logger struct
type Logger interface {
        RequestPrintf(format string, args ...interface{})
        ResponsePrintf(format string, args ...interface{})
}

Do you have objections?

jtopjian commented 4 years ago

What benefits would this provide?

kayrus commented 4 years ago

You can use different log prefixes for a visual segregation of the request and response.

jtopjian commented 4 years ago

I haven't come across an interface like this in other projects - my concern is that someone will need to implement a unique interface just to see the request/response information.