Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Disabling logging on 7.0.0-alpha.1 #1581

Closed
rainwater11 opened this issue Nov 15, 2021 · 6 comments · Fixed by #1587
Closed

Disabling logging on 7.0.0-alpha.1 #1581

rainwater11 opened this issue Nov 15, 2021 · 6 comments · Fixed by #1587
Assignees
Milestone

Comments

@rainwater11
Copy link

I am seeing several of these being logged to the console and would like to turn them off if possible:
eth_blockNumber
eth_chainId

How can I do this?

@davidmurdoch
Copy link
Member

Looks like the --quiet flag has a bug. Thanks for reporting!

@rainwater11
Copy link
Author

Looks like the --quiet flag has a bug. Thanks for reporting!

Not a problem! Is there any way I can temporarily fix this?

@davidmurdoch
Copy link
Member

On unix you can redirect all output to nothing: ganache > /dev/null. On Windows you may be able to use ganache >NUL (I haven't tried it myself).

@rainwater11
Copy link
Author

On unix you can redirect all output to nothing: ganache > /dev/null. On Windows you may be able to use ganache >NUL (I haven't tried it myself).

Ok but I am using Ganache programmatically and not launching from the command line.

@davidmurdoch
Copy link
Member

davidmurdoch commented Nov 16, 2021

Oh. You can pass your own logger to ganache:

ganache.provider({ 
  logging: {
    logger: {
      log: () => {} // don't do anything
    }
  }
});

@rainwater11
Copy link
Author

Oh. You can pass your own logger to ganache:

ganache.provider({ 
  logging: {
    logger: {
      log: () => {} // don't do anything
    }
  }
});

Hey that works! Thank you!

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants