On Thursday, September 27, 2018 at 2:42:45 AM UTC-7, Janko Marohnić wrote:
>
> Hey Jeremy,
>
> First of all, thanks a bunch for the new caller_logging extension, I'm
> finding it really useful!
>
> I noticed that when I use the Postgres adapter with the sequel_pg
> extension, the sequel_pg gem often shows as the query caller. Here is an
> example showing this:
>
> require "sequel"
> require "logger"
>
> system "createdb testing"
> DB = Sequel.postgres("testing")
>
> at_exit do
> DB.disconnect
> system "dropdb testing"
> end
>
> DB.logger = Logger.new(STDOUT)
> DB.extension :caller_logging
>
> DB.get(1) # => 1
>
> # >> I, [2018-09-27T11:35:53.100266 #21363] INFO -- : (0.001142s)
> (source:
> /Users/janko/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sequel_pg-1.8.2/lib/sequel_pg/sequel_pg.rb:81:in
>
> `each') SELECT CAST(current_setting('server_version_num') AS integer) AS v
> # >> I, [2018-09-27T11:35:53.101002 #21363] INFO -- : (0.000307s)
> (source:
> /Users/janko/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sequel_pg-1.8.2/lib/sequel_pg/sequel_pg.rb:81:in
>
> `each') SELECT 1 AS "v" LIMIT 1
>
> I know that I can do
>
> DB.caller_logging_ignore = "sequel_pg"
>
> But I was wondering, since it's very common to have sequel_pg included,
> whether the caller_logging extension might exclude it automatically. Though
> I would understand if you wouldn't like the caller_logging extension to
> have knowledge of sequel_pg.
>
Correct, this is something I would expect to use caller_logging_ignore
for. If I start automatically excluding sequel_pg, other libraries can ask
for and reasonably expect the same treatment.
Thanks,
Jeremy
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.