🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

pixl-logger

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pixl-logger - npm Package Compare versions

Comparing version

to
1.0.4

3

logger.js

@@ -94,3 +94,4 @@ // Generic Logger Class for Node.JS

// append to log
fs.appendFile(path, line);
if (this.args.sync) fs.appendFileSync(path, line);
else fs.appendFile(path, line);

@@ -97,0 +98,0 @@ // echo to console if desired

{
"name": "pixl-logger",
"version": "1.0.3",
"version": "1.0.4",
"description": "A simple logging class which generates [bracket][delimited] log columns.",

@@ -5,0 +5,0 @@ "author": "Joseph Huckaby <jhuckaby@gmail.com>",

@@ -249,2 +249,14 @@ # Overview

## Sync or Async
By default, the logger will append to your log files asynchronously. This has the benefit of not blocking your main thread, and can help if your log drive is suffering lag or high I/O wait. But it *may* cause issues with log entries appearing out of order for extremely high traffic apps, and also some final log entries may be lost if `process.exit()` is called *immediately* after.
To get around these potential issues, you can write log entries synchronously. Just set the `sync` arg to true:
```javascript
logger.set( 'sync', true );
logger.debug( 1, "This will be logged synchronously, even if we exit right NOW!" );
process.exit(0);
```
# License

@@ -251,0 +263,0 @@