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

share / sharedb / 915
96%
master: 97%

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

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(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.
});
```

1093 of 1313 branches covered (83.24%)

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

2316 of 2424 relevant lines covered (95.54%)

402.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 915.1 15 Nov 2018 10:25AM UTC 0
95.54
Travis Job 915.1
2 915.2 15 Nov 2018 10:24AM UTC 0
95.54
Travis Job 915.2
3 915.3 15 Nov 2018 10:25AM UTC 0
95.54
Travis Job 915.3
Source Files on build 915
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #915
  • 002c4c2c on github
  • Prev Build on logger-override (#914)
  • Next Build on logger-override (#923)
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