Documentation ¶
Overview ¶
Package log defines the logging interface used internally by the driver and provides default logging implementations.
Index ¶
Constants ¶
const ( Bolt3 = "bolt3" Bolt4 = "bolt4" Bolt5 = "bolt5" Driver = "driver" Pool = "pool" Router = "router" Session = "session" )
List of component names used as parameter to logger functions.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoltLogger ¶
type Console ¶
Console is a simple logger that logs to stdout/console. Turn the different log levels on/off as wished, all are off by default.
type ConsoleBoltLogger ¶
type ConsoleBoltLogger struct { }
func (*ConsoleBoltLogger) LogClientMessage ¶
func (cbl *ConsoleBoltLogger) LogClientMessage(id, msg string, args ...any)
func (*ConsoleBoltLogger) LogServerMessage ¶
func (cbl *ConsoleBoltLogger) LogServerMessage(id, msg string, args ...any)
type Logger ¶
type Logger interface { // Error is called whenever the driver encounters an error that might // or might not cause a retry operation which means that all logged // errors are not critical. Type of err might or might not be a publicly // exported type. The same root cause of an error might be reported // more than once by different components using same or different err types. Error(name string, id string, err error) Warnf(name string, id string, msg string, args ...any) Infof(name string, id string, msg string, args ...any) Debugf(name string, id string, msg string, args ...any) }
Logger is used throughout the driver for logging purposes. Driver client can implement this interface and provide an implementation upon driver creation.
All logging functions takes a name and id that corresponds to the name of the logging component and it's identity, for example "router" and "1" to indicate who is logging and what instance.
Database connections takes to form of "bolt3" and "bolt-123@192.168.0.1:7687" where "bolt3" is the name of the protocol handler in use, "bolt-123" is the databases identity of the connection on server "192.168.0.1:7687".