denodrivers / postgres

PostgreSQL driver for Deno

Home Page:https://denodrivers.github.io/postgres

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

suggestion: Way to disable notices

DjDeveloperr opened this issue · comments

commented

There should be a way to disable these notices:

img

Because not everyone wants it in their applications.

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.

+1 it breaks the logs and looks ugly

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)
}
commented

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.