@prairielearn/logger 1.0.14 → 2.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @prairielearn/logger
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 4f30b7e: Publish as native ESM
8
+
9
+ ## 1.0.15
10
+
11
+ ### Patch Changes
12
+
13
+ - c7e6553: Upgrade all JavaScript dependencies
14
+
3
15
  ## 1.0.14
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,22 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addFileLogging = exports.logger = void 0;
4
- const winston_1 = require("winston");
5
- const logform_1 = require("logform");
6
- exports.logger = (0, winston_1.createLogger)({
1
+ import { createLogger, transports } from 'winston';
2
+ import { format } from 'logform';
3
+ export const logger = createLogger({
7
4
  transports: [
8
- new winston_1.transports.Console({
5
+ new transports.Console({
9
6
  level: 'info',
10
- format: logform_1.format.combine(logform_1.format.colorize(), logform_1.format.simple()),
7
+ format: format.combine(format.colorize(), format.simple()),
11
8
  }),
12
9
  ],
13
10
  });
14
- function addFileLogging(options) {
15
- exports.logger.add(new winston_1.transports.File({
11
+ export function addFileLogging(options) {
12
+ logger.add(new transports.File({
16
13
  filename: options.filename,
17
14
  level: options.level ?? 'debug',
18
- format: logform_1.format.combine(logform_1.format.timestamp(), logform_1.format.json()),
15
+ format: format.combine(format.timestamp(), format.json()),
19
16
  }));
20
17
  }
21
- exports.addFileLogging = addFileLogging;
22
18
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,qCAAiC;AAEpB,QAAA,MAAM,GAAG,IAAA,sBAAY,EAAC;IACjC,UAAU,EAAE;QAC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AM,CAAC,IAAI,EAAE,CAAC;KAC1D,CAAC,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { createLogger, transports } from 'winston';\nimport { format } from 'logform';\n\nexport const logger = createLogger({\n transports: [\n new transports.Console({\n level: 'info',\n format: format.combine(format.colorize(), format.simple()),\n }),\n ],\n});\n\ninterface AddFileLoggingOptions {\n filename: string;\n level?: string;\n}\n\nexport function addFileLogging(options: AddFileLoggingOptions) {\n logger.add(\n new transports.File({\n filename: options.filename,\n level: options.level ?? 'debug',\n format: format.combine(format.timestamp(), format.json()),\n }),\n );\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@prairielearn/logger",
3
- "version": "1.0.14",
3
+ "version": "2.0.0",
4
+ "type": "module",
4
5
  "main": "./dist/index.js",
5
6
  "repository": {
6
7
  "type": "git",
@@ -13,7 +14,7 @@
13
14
  },
14
15
  "devDependencies": {
15
16
  "@prairielearn/tsconfig": "^0.0.0",
16
- "@types/node": "^20.11.30",
17
+ "@types/node": "^20.12.2",
17
18
  "typescript": "^5.4.3"
18
19
  },
19
20
  "dependencies": {