Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thomseddon/chatty
Sexy syslogging for node.js
https://github.com/thomseddon/chatty
Last synced: 2 months ago
JSON representation
Sexy syslogging for node.js
- Host: GitHub
- URL: https://github.com/thomseddon/chatty
- Owner: thomseddon
- Created: 2013-12-06T18:29:14.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-12-18T00:23:13.000Z (almost 11 years ago)
- Last Synced: 2024-08-29T18:37:29.043Z (4 months ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chatty
Sexy syslogging for node.js
## Install
````js
npm install chatty
````## Usage
#### Manual
```js
var chatty = require('chatty');chatty.info('Hello');
````#### Express
```js
var express = require('express');
var chatty = require('chatty');app.use(express.logger({ stream: chatty.stream() }));
app.get('/', function (req, res) {
res.send('Hello');
});app.listen(3000);
````## API
#### chatty.info(data)
Syslog with `LOG_INFO` priority#### chatty.error(data)
Syslog with `LOG_ERR` priority#### chatty.debug(data)
Syslog with `LOG_DEBUG` priority#### chatty.stream(priority, options)
Return a syslog stream wrapper with specified priority.`priority` can be either a syslog priority or any of the strings: `info`, `error` or `debug`. (`LOG_INFO` by default)
`options` is merged with the default and passed into the stream constructor
#### chatty.configure(options)
Configure chatty, availiable options are: `ident`, `option` and `facility` ([syslog man page](http://linux.die.net/man/3/syslog))
An extra option `console`, may be set to true to log messages with console.log rather than syslog (useful for development/debugging)#### chatty.log(priority, data)
Direct wrapper of syslog (you probably DON'T want this).
`priority` must be a syslog.prority int