Commit Graph

12 Commits (b8486d6749f293951a5586a0a122fbf0787cf2b5)

Author SHA1 Message Date
Jack Christensen cffae7ff5d Add SetLogger to *Conn
Allow replacing logger after connection is established. Also
refactor internals of logging such that there is a log method that
adds the pid to all log calls instead of making a new logger object.
The reason for this is so pid will be logged regardless of whether
loggers are replaced and restored.
2016-02-12 17:49:04 -06:00
Jack Christensen 51407590eb Add LogLevelFromString func 2015-09-16 09:21:51 -05:00
Jack Christensen a1aa06c934 More efficient logging with log levels 2015-09-16 08:20:51 -05:00
Karl Seguin a8f5ce12c5 Trying to reduce memory allocation. logQueryArgs is called even when
using the default discardLogger. This allocates quite a bit of memory.
Created a default dlogger instance and avoid logging code when that's our
logger. I couldn't think of a better implementation without touching the
Logger interface.

On 100 000 inserts, this brought the allocation down to 58MB from 122MB.
It should also result in some small performance gains.
2014-11-18 07:53:33 +07:00
Jack Christensen 92cbc6566d Fix log truncation 2014-09-15 14:27:28 -05:00
Jack Christensen b21a653085 Truncate logged strings and byte slices 2014-09-15 13:53:59 -05:00
Jack Christensen f5156ac4eb discardLogger should be private 2014-09-04 16:45:35 -05:00
Jack Christensen 717ca04aa7 Remove Crit from pgx.Logger
Nothing pgx should do should generate a Crit / Fatal error (program
must terminate now). The higher level program should make those
decisions.
2014-09-04 16:40:26 -05:00
Jack Christensen ff905fe862 Finish compatible interface to inconshreveable/log15 2014-09-04 16:27:40 -05:00
Jack Christensen 98109c57bb Use interface for logging instead of log15 directly 2014-09-04 16:00:53 -05:00
Jack Christensen cbddbb423e Replace logging functionality with log15
gopkg.in/inconshreveable/log15.v2
2014-06-02 19:47:09 -05:00
Jack Christensen f76489f7d7 Add basic logging to pgx
fixes #21
2013-11-05 15:09:50 -06:00