Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pixl-logger

Package Overview
Dependencies
Maintainers
1
Versions
24
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 1.0.3 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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc