Go Driver debug logging

nzgo defines a simple logger interface.

Set LogLevel to control logging verbosity and LogPath to specify log file path.

To enable logging for the driver, write the following code in your application:
var elog nzgo.PDALogger
elog.LogLevel = "off"
elog.LogPath = "C:\\Logs\\"
elog.Initialize()
Declaring elog variable and calling elog.Initialize() function is mandatory. If you do not do that, the application will fail with a runtime error: runtime error: invalid memory address or nil pointer dereference.

You can configure LogLevel and LogPath (i.e. log file directory) if required. You can skip initializing the LogLevel and LogPath values. If skipped, they take the default values.

The default value for LogLevel is DEBUG. The default directory for LogPath is the directory where your application resides.

Possible values for LogLevel are:
  • OFF
  • DEBUG
  • INFO
  • FATAL