Is there a way to get the sql query log from https://github.com/jinzhu/gorm?
e.g. in dev environment, it would be useful to be able to log to the console the mysql queries that have been called.
e.g. how to get the underlying sql query log for the following queries:
I am aware that I can call:
but I would like to only call
Debug() if in dev envrionment and not in production
This will do the trick:
db, err:= Open(dbType, connectionDSN); db.LogMode(true)
Answered By – Ronna