breejs / bree

Bree is a Node.js and JavaScript job task scheduler with worker threads, cron, Date, and human syntax. Built for @ladjs, @forwardemail, @spamscanner, @cabinjs.
https://jobscheduler.net
MIT License
3.01k stars 78 forks source link

[feat] Option to disable logging #147

Closed MA-MacDonald closed 2 years ago

MA-MacDonald commented 2 years ago

Could you add an option to disable logging?

I have many jobs running and the logging going to the console is making it hard to read some other outputs I am sending to the console.

shadowgate15 commented 2 years ago

You can pass a noop logger to Bree in the constructor.

MA-MacDonald commented 2 years ago

ok thanks I'll try that.

niftylettuce commented 2 years ago

We should add ability to pass false as a Boolean @shadowgate15 which would in turn make it a noop

On Tuesday, November 30, 2021, Michael MacDonald @.***> wrote:

Closed #147 https://github.com/breejs/bree/issues/147.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/breejs/bree/issues/147#event-5696107376, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD7XBM7BXW7A64VQ77DIB3UOWIRJANCNFSM5JDMKIGQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

SpellChucker commented 2 years ago

FYI for anyone wanting to do this, you can provide your logger as follows:

const bree = new Bree({
  ...
  logger: { info: () => {}, error: () => {}, warn: () => {} },
  ...
});

Not pretty but will do as suggested.

niftylettuce commented 2 years ago

You can set logger: false in v7.1.2 now, just published to npm 🔥

https://github.com/breejs/bree/releases/tag/v7.1.2