• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

share / sharedb / 916
96%
master: 97%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/actions/checkout-6
DEFAULT BRANCH: master
Ran 15 Nov 2018 10:37AM UTC
Jobs 3
Files 26
Run time 8s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
916

Pull #258

travis-ci

web-flow
Allow custom logger overrides

This change adds the ability to override ShareDB's logging behaviour.

By default, ShareDB will still log to `console`. However, this default
can be overridden with custom methods on both the backend and in the
client.

## Supported methods

The ShareDB logger only supports the following methods:

  - `info`
  - `warn`
  - `error`

Any method that is not overridden will default to `console`.

## Backend

The backend methods can be overridden when instantiating `Backend`:

```javascript
var share = new Backend({
  logger: {
    info: () => {},                         // Silence info
    warn: () => alerts.warn(arguments),     // Forward warnings
    error: () => alerts.critical(arguments) // Map errors to critical
  }
});
```

## Client

Client methods can also be overridden:

```javascript
var ShareDB = require('sharedb/lib/client');
ShareDB.logger.setMethods({
  info: () => {},
  // etc.
});
```
Pull Request #258: Allow custom logger overrides

1094 of 1313 branches covered (83.32%)

30 of 30 new or added lines in 7 files covered. (100.0%)

2316 of 2424 relevant lines covered (95.54%)

401.85 hits per line

Jobs
ID Job ID Ran Files Coverage
1 916.1 15 Nov 2018 10:37AM UTC 0
95.54
Travis Job 916.1
2 916.2 15 Nov 2018 10:37AM UTC 0
95.54
Travis Job 916.2
3 916.3 15 Nov 2018 10:37AM UTC 0
95.54
Travis Job 916.3
Source Files on build 916
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #916
  • Pull Request #258
  • PR Base - master (#912)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc