Code Monkey home page Code Monkey logo

Comments (5)

sorentwo avatar sorentwo commented on July 30, 2024

Are you able to replicate this with a simple Ecto query where you specify log: false? Oban isn't doing anything fancy with the verbose value, it is passing it through as log: true or log: false for each query.

from oban.

lucasmazza avatar lucasmazza commented on July 30, 2024

@sorentwo we can replicate this with:

Ecto.Adapters.SQL.query!(Testapp.Repo, "SELECT 1 AS one", [], log: true)

The log: true matches the defaults from Oban.Config

from oban.

lucasmazza avatar lucasmazza commented on July 30, 2024

On a side one, if we supply a log level, instead of true, the query is logged as expected, overriding the repo config:

Keyword.get(Testapp.Repo.config(), :log)
# false
Ecto.Adapters.SQL.query!(Testapp.Repo, "SELECT 1 AS one", [], log: :info)
# [info] QUERY OK db=0.4ms queue=0.7ms
# SELECT 1 AS one []

The documentation on Ecto.Repo has the following to say about the :log option:

the log level used when logging the query with Elixir's Logger. If false, disables 
logging for that repository. Defaults to :debug

Is never explicitly said to support true (like verbose does here), so maybe oban should follow the same semantics of "log_level or false" instead of being either "true and false"?

from oban.

sorentwo avatar sorentwo commented on July 30, 2024

@lucasmazza Thanks gain. Pushed a patch that prevents this from happening, and encourages a more sensible default.

from oban.

lucasmazza avatar lucasmazza commented on July 30, 2024

@sorentwo thanks for the always fast and focused patches ❤️

from oban.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.