2
0

Remove Conn SetLogger and SetLogLevel

Simplifying interface
This commit is contained in:
Jack Christensen
2019-08-17 15:34:29 -05:00
parent 99c54fbec0
commit f3c703a102
3 changed files with 32 additions and 121 deletions
-20
View File
@@ -317,26 +317,6 @@ func (c *Conn) log(ctx context.Context, lvl LogLevel, msg string, data map[strin
c.logger.Log(ctx, lvl, msg, data)
}
// SetLogger replaces the current logger and returns the previous logger.
func (c *Conn) SetLogger(logger Logger) Logger {
oldLogger := c.logger
c.logger = logger
return oldLogger
}
// SetLogLevel replaces the current log level and returns the previous log
// level.
func (c *Conn) SetLogLevel(lvl LogLevel) (LogLevel, error) {
oldLvl := c.logLevel
if lvl < LogLevelNone || lvl > LogLevelTrace {
return oldLvl, ErrInvalidLogLevel
}
c.logLevel = lvl
return lvl, nil
}
func quoteIdentifier(s string) string {
return `"` + strings.Replace(s, `"`, `""`, -1) + `"`
}