Remote logger for node-bunyan that logs to the browser via Bunyan DevTools
Note: this modules is still in beta version
npm install bunyan-remote --save
var bunyan = ;var remoteBunyan = ;var logger = bunyan;logger;logger;
bunyan-remote can be used with the following optional properties:
allowedIPs: An array of IP expressions where "" signifys any (e.g 10. - all IP's that start with 10.X.X.X)
auth: One of the following options:
remoteBunyan.AUTH_NONE: No authentication required by Bunyan Remote DevTool.
remoteBunyan.AUTH_KEY: Prompt Bunyan Remote DevTool for a key.
remoteBunyan.AUTH_USER: Prompt Bunyan Remote DevTool for a username and password.
authenticate: A string, or a function which verifies the authentcation of the client.
AUTH_USER, you can set the
authenticate property to either a string or a function.
auth is set to
AUTH_KEY then the
authenticate property will be compared to a regular token string.
auth is set to
AUTH_USER then the
authenticate property will be compared to a combination of the username and password in the format
The following example uses a simple key for authentication:
You can also specify a function that returns a boolean wether to allow or deny the authentication request:
var TOKENS = 'SECRET-KEY-1' 'SECRET-KEY-2' ;logger;
If you're working with asynchronous operations you can do one of two things. One return
function (accept, reject) where the parameters indicate to accept/reject the request:
or better yet return an ES6 Promise: (recommended)
bugsbunny:carrots48 elmerfudd:wabbits24 tweetybird:puttytat12
The Bunyan Remote DevTool Chrome Extension can be downloaded via the Chrome Web Store
The MIT License (MIT)
Copyright (c) 2016 Alejandro Gonzalez Sole
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.