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

share / sharedb / 914
96%
master: 97%

Build:
Build:
LAST BUILD BRANCH: dependabot/github_actions/actions/checkout-6
DEFAULT BRANCH: master
Ran 15 Nov 2018 10:15AM UTC
Jobs 3
Files 26
Run time 14s
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
914

push

travis-ci

Alec Gibson
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,     // Forward warnings to alerting service
    error: alerts.critical // Map errors to critical alerts
  }
});
```

## Client

Client methods can also be overridden:

```javascript
var ShareDB = require('sharedb/lib/client');
ShareDB.logger.setMethods({
  info: () => {},
  // etc.
});
```

1093 of 1313 branches covered (83.24%)

2316 of 2424 relevant lines covered (95.54%)

401.71 hits per line

Jobs
ID Job ID Ran Files Coverage
1 914.1 15 Nov 2018 10:15AM UTC 0
95.54
Travis Job 914.1
2 914.2 15 Nov 2018 10:15AM UTC 0
95.54
Travis Job 914.2
3 914.3 15 Nov 2018 10:15AM UTC 0
95.54
Travis Job 914.3
Source Files on build 914
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #914
  • 13ed72aa on github
  • Next Build on logger-override (#915)
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