https://github.com/csimi/optional-syslog
Syslog package that exposes modern-syslog when possible, otherwise provides a stub
https://github.com/csimi/optional-syslog
optional posix syslog windows
Last synced: 10 months ago
JSON representation
Syslog package that exposes modern-syslog when possible, otherwise provides a stub
- Host: GitHub
- URL: https://github.com/csimi/optional-syslog
- Owner: csimi
- License: isc
- Created: 2019-11-18T14:24:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T06:35:13.000Z (about 3 years ago)
- Last Synced: 2025-04-18T08:22:30.686Z (10 months ago)
- Topics: optional, posix, syslog, windows
- Language: JavaScript
- Size: 453 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/optional-syslog)
[](https://github.com/csimi/optional-syslog/actions)
# About
This package installs [modern-syslog](https://www.npmjs.com/package/modern-syslog) as an optional dependency for ease of use on Windows (via a stub) and exposes some of its API.
There is also a compatiblity layer for users of the [posix](https://www.npmjs.com/package/posix) package (syslog related functions, drop-in replacement).
Constants are provided by [syslog-constants](https://www.npmjs.com/package/syslog-constants) and are always available.
# Usage
Install using npm:
```
$ npm install optional-syslog
```
Replace
```
require('modern-syslog');
```
or
```
require('posix');
```
with
```
require('optional-syslog');
```
# Exported properties and methods
## syslog-constants (except named as in modern-syslog)
* facility
* level
* option
Documentation at https://www.npmjs.com/package/syslog-constants#properties
## modern-syslog
* log
* open
* close
* upto
* setmask
Documentation at https://www.npmjs.com/package/modern-syslog#api
Not provided are:
* formatted versions of `log()`
* streaming API
* curmask (since it's a read operation and can't be noop'd)
## posix
* openlog
* closelog
* setlogmask
* syslog
Documentation at https://www.npmjs.com/package/posix#syslog