New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sealsystems/log

Package Overview
Dependencies
Maintainers
0
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sealsystems/log - npm Package Compare versions

Comparing version 2.4.3 to 2.5.0

lib/loggerFactory/formatter/asHumanReadable.js

6

lib/logAndTerminate.js
'use strict';
const { flaschenpost } = require('flaschenpost');
const { loggerFactory } = require('./loggerFactory');
const logAndTerminate = function (err, promise) {
if (promise) {
flaschenpost.getLogger().fatal('Unhandled rejection occurred. Terminate process.', { err, promise });
loggerFactory.getLogger().fatal('Unhandled rejection occurred. Terminate process.', { err, promise });
} else {
flaschenpost.getLogger().fatal('Uncaught exception occurred. Terminate process.', { err });
loggerFactory.getLogger().fatal('Uncaught exception occurred. Terminate process.', { err });
}

@@ -11,0 +11,0 @@

'use strict';
// Parse environment variable LOG_LEVEL if set, overwrites LOG_LEVELS
require('./parseLogLevelEnv')();
const { loggerFactory } = require('./loggerFactory');
const { flaschenpost } = require('flaschenpost');
const logAndTerminate = require('./logAndTerminate');
const getMiddleware = require('./getMiddleware');

@@ -18,22 +14,2 @@ // 1. Do not log multiple times if different versions of this module are required in the project

const defaultConfig = flaschenpost.getConfiguration();
flaschenpost.configure(
defaultConfig.withFormatter((logEntry) => {
logEntry.isoTimestamp = new Date(logEntry.timestamp).toISOString();
if (logEntry.metadata) {
// try to avoid type mismatches in elasticsearch (pls-1626)
if (typeof logEntry.metadata !== 'object') {
logEntry.metadata = { value: logEntry.metadata.toString() };
}
// Temporary: If incoming metadata is not of type object, transform it.
// This is neccessary to fit the type definitions in ELK
else if (logEntry.metadata.err && typeof logEntry.metadata.err !== 'object') {
logEntry.metadata.err = { message: logEntry.metadata.err.toString() };
}
}
return defaultConfig.formatter(logEntry);
})
);
flaschenpost.Middleware = getMiddleware(flaschenpost);
module.exports = flaschenpost;
module.exports = loggerFactory;
{
"name": "@sealsystems/log",
"version": "2.4.3",
"version": "2.5.0",
"description": "Logger for all Node.js modules by SEAL Systems",

@@ -28,11 +28,16 @@ "author": {

"dependencies": {
"flaschenpost": "5.0.49",
"stack-trace": "0.0.10"
"app-root-path": "3.1.0",
"chalk": "4.1.2",
"find-root": "1.1.0",
"lodash": "4.17.21",
"serialize-error": "8.1.0",
"stack-trace": "0.0.10",
"stringify-object": "3.3.0"
},
"devDependencies": {
"@sealsystems/eslint-config-es": "3.7.8",
"@sealsystems/eslint-config-es": "3.7.10",
"@sealsystems/mocha": "4.2.3",
"nodeenv": "3.0.71",
"nodeenv": "3.0.75",
"proxyquire": "2.1.3",
"sinon": "12.0.1"
"sinon": "19.0.2"
},

@@ -39,0 +44,0 @@ "release": {

@@ -10,3 +10,3 @@ # @sealsystems/log

```bash
$ npm install @sealsystems/log
npm install @sealsystems/log
```

@@ -62,34 +62,7 @@

## Environment Variables
## Environment Variable LOG_LEVEL
_Please note that when using mocha, all log-levels are always activated. See [`flaschenpost`](https://www.npmjs.com/package/flaschenpost#setting-a-custom-host)._
### LOG_LEVELS
A list of log levels to print out. Possible levels are:
- `debug`
- `info`
- `warn`
- `error`
- `fatal`
You have to provide a comma seperated list of the log levels you are interessted in:
```
LOG_LEVELS=info,warn,error,fatal
```
The list given above is the default setting, if no environment variable is set.
You can enable all logging levels with the shortcut
```
LOG_LEVELS=*
```
### LOG_LEVEL
A single minimum log level which includes all higher levels.
```
```bash
LOG_LEVEL=warn

@@ -99,3 +72,1 @@ ```

The setting above includes log levels `warn`, `error` and `fatal`.
The environment variable `LOG_LEVEL` has precedence over `LOG_LEVELS`.
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