Closed sgwilym closed 3 years ago
How about a global singleton that sets log detail levels?
import {
setLogLevels
} from 'earthstar'
setLogLevels({
// many various kinds of logs, each default to zero but can be increased for more detail
sync: 2,
storage: 1,
});
@cinnamon-bun Something like that sounds great. Maybe I'll take a crack at this myself!
@sgwilym
The various kinds of log messages are defined in src/util/log.ts
.
What's the problem you want solved?
Earthstar logs a lot of messages to do with syncing while being used (and even when syncing is not enabled). These also pop up in places like test environments, where it becomes a bit of a drag searching for your test errors among hundreds of these messages.
They also appear in any web app that uses earthstar, which creates a similar problem with noise.
Is there a solution you'd like to recommend?
Could this logging only be done if a certain argument is passed somewhere?