@commercetools-backend/loggers 27.14.0 → 27.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,8 +103,7 @@ const mapRequestMetadata = request => {
103
103
  }
104
104
  };
105
105
 
106
- const createAccessLoggerMiddleware = function () {
107
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
106
+ const createAccessLoggerMiddleware = (options = {}) => {
108
107
  const formatters = winston__namespace["default"].format.combine(winston__namespace["default"].format.timestamp(), ...(options.formatters ?? []), options.json ? winston__namespace["default"].format.json() : winston__namespace["default"].format.cli());
109
108
  const skip = createAccessLogSkipper(options);
110
109
  return expressWinston__default["default"].logger({
@@ -120,8 +119,7 @@ const createAccessLoggerMiddleware = function () {
120
119
  });
121
120
  };
122
121
 
123
- const createApplicationLogger = function () {
124
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
122
+ const createApplicationLogger = (options = {}) => {
125
123
  const formatters = winston__namespace.format.combine(...(options.formatters ?? []), options.json ? winston__namespace.format.json() : winston__namespace.format.combine(winston__namespace.format.cli(), winston__namespace.format.simple()));
126
124
  return winston__namespace.createLogger({
127
125
  level: options.level ?? 'info',
@@ -103,8 +103,7 @@ const mapRequestMetadata = request => {
103
103
  }
104
104
  };
105
105
 
106
- const createAccessLoggerMiddleware = function () {
107
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
106
+ const createAccessLoggerMiddleware = (options = {}) => {
108
107
  const formatters = winston__namespace["default"].format.combine(winston__namespace["default"].format.timestamp(), ...(options.formatters ?? []), options.json ? winston__namespace["default"].format.json() : winston__namespace["default"].format.cli());
109
108
  const skip = createAccessLogSkipper(options);
110
109
  return expressWinston__default["default"].logger({
@@ -120,8 +119,7 @@ const createAccessLoggerMiddleware = function () {
120
119
  });
121
120
  };
122
121
 
123
- const createApplicationLogger = function () {
124
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
122
+ const createApplicationLogger = (options = {}) => {
125
123
  const formatters = winston__namespace.format.combine(...(options.formatters ?? []), options.json ? winston__namespace.format.json() : winston__namespace.format.combine(winston__namespace.format.cli(), winston__namespace.format.simple()));
126
124
  return winston__namespace.createLogger({
127
125
  level: options.level ?? 'info',
@@ -62,8 +62,7 @@ const mapRequestMetadata = request => {
62
62
  }
63
63
  };
64
64
 
65
- const createAccessLoggerMiddleware = function () {
66
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
65
+ const createAccessLoggerMiddleware = (options = {}) => {
67
66
  const formatters = winston__default.format.combine(winston__default.format.timestamp(), ...(options.formatters ?? []), options.json ? winston__default.format.json() : winston__default.format.cli());
68
67
  const skip = createAccessLogSkipper(options);
69
68
  return expressWinston.logger({
@@ -79,8 +78,7 @@ const createAccessLoggerMiddleware = function () {
79
78
  });
80
79
  };
81
80
 
82
- const createApplicationLogger = function () {
83
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
81
+ const createApplicationLogger = (options = {}) => {
84
82
  const formatters = winston.format.combine(...(options.formatters ?? []), options.json ? winston.format.json() : winston.format.combine(winston.format.cli(), winston.format.simple()));
85
83
  return winston.createLogger({
86
84
  level: options.level ?? 'info',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercetools-backend/loggers",
3
- "version": "27.14.0",
3
+ "version": "27.16.0",
4
4
  "description": "Opinionated JSON loggers for HTTP server applications",
5
5
  "bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
6
6
  "repository": {
@@ -48,6 +48,6 @@
48
48
  "typescript": "5.9.3"
49
49
  },
50
50
  "engines": {
51
- "node": "18.x || 20.x || >=22.0.0"
51
+ "node": "^22.23.4 || ^24.22.1 || >=26.12.1"
52
52
  }
53
53
  }