postgres icon indicating copy to clipboard operation
postgres copied to clipboard

suggestion: Way to disable notices

Open DjDeveloperr opened this issue 4 years ago • 4 comments

There should be a way to disable these notices:

img

Because not everyone wants it in their applications.

DjDeveloperr avatar Feb 18 '21 14:02 DjDeveloperr

I agree. Logs should be totally optional, it is up to the developer to decide whether they want their stdout to be altered by other packages.

andreespirela avatar Feb 18 '21 14:02 andreespirela

+1 it breaks the logs and looks ugly

al6x avatar May 21 '21 08:05 al6x

If anyone needs a quick fix

// Hiding notice warnings
import { parseNotice } from "postgres/connection/warning.ts"
import { Connection } from "postgres/connection/connection.ts"

(Connection.prototype as any).processNotice = function(msg: any): any {
  return parseNotice(msg)
}

al6x avatar May 21 '21 09:05 al6x

Any new quick fixes for disabling notices? Really annoying having them show up in my logs. The skipping notices are getting on my nerves to no end.

imjamesb avatar Jul 21 '22 08:07 imjamesb