@prairielearn/logger 1.0.15 → 2.0.1

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.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 901fce8: Upgrade all JavaScript dependencies
8
+
9
+ ## 2.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - 4f30b7e: Publish as native ESM
14
+
3
15
  ## 1.0.15
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 { format } from 'logform';
2
+ import { createLogger, transports } from 'winston';
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 { format } from 'logform';\nimport { createLogger, transports } from 'winston';\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.15",
3
+ "version": "2.0.1",
4
+ "type": "module",
4
5
  "main": "./dist/index.js",
5
6
  "repository": {
6
7
  "type": "git",
@@ -13,12 +14,12 @@
13
14
  },
14
15
  "devDependencies": {
15
16
  "@prairielearn/tsconfig": "^0.0.0",
16
- "@types/node": "^20.12.2",
17
- "typescript": "^5.4.3"
17
+ "@types/node": "^20.12.11",
18
+ "typescript": "^5.4.5"
18
19
  },
19
20
  "dependencies": {
20
21
  "logform": "^2.6.0",
21
22
  "winston": "^3.13.0",
22
- "zod": "^3.22.4"
23
+ "zod": "^3.23.8"
23
24
  }
24
25
  }
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { createLogger, transports } from 'winston';
2
1
  import { format } from 'logform';
2
+ import { createLogger, transports } from 'winston';
3
3
 
4
4
  export const logger = createLogger({
5
5
  transports: [