@prairielearn/logger 1.0.0 → 1.0.2

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 ADDED
@@ -0,0 +1,13 @@
1
+ # @prairielearn/logger
2
+
3
+ ## 1.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 2b003b4d9: Upgrade all dependencies
8
+
9
+ ## 1.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 8fd47d928: Upgrade all dependencies
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import winston from 'winston';
2
- export declare const logger: winston.Logger;
1
+ export declare const logger: import("winston").Logger;
3
2
  interface AddFileLoggingOptions {
4
3
  filename: string;
5
4
  level?: string;
package/dist/index.js CHANGED
@@ -1,21 +1,18 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.addFileLogging = exports.logger = void 0;
7
- const winston_1 = __importDefault(require("winston"));
4
+ const winston_1 = require("winston");
8
5
  const logform_1 = require("logform");
9
- exports.logger = winston_1.default.createLogger({
6
+ exports.logger = (0, winston_1.createLogger)({
10
7
  transports: [
11
- new winston_1.default.transports.Console({
8
+ new winston_1.transports.Console({
12
9
  level: 'info',
13
10
  format: logform_1.format.combine(logform_1.format.colorize(), logform_1.format.simple()),
14
11
  }),
15
12
  ],
16
13
  });
17
14
  function addFileLogging(options) {
18
- exports.logger.add(new winston_1.default.transports.File({
15
+ exports.logger.add(new winston_1.transports.File({
19
16
  filename: options.filename,
20
17
  level: options.level ?? 'debug',
21
18
  format: logform_1.format.combine(logform_1.format.timestamp(), logform_1.format.json()),
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAC9B,qCAAiC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SAAS,EAAE,EAAE,gBAAM,CAAC,IAAI,EAAE,CAAC;KAC1D,CAAC,CACH,CAAC;AACJ,CAAC;AARD,wCAQC"}
package/package.json CHANGED
@@ -1,19 +1,24 @@
1
1
  {
2
2
  "name": "@prairielearn/logger",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "main": "./dist/index.js",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/PrairieLearn/PrairieLearn.git",
8
+ "directory": "packages/logger"
9
+ },
5
10
  "scripts": {
6
11
  "build": "tsc",
7
12
  "dev": "tsc --watch --preserveWatchOutput"
8
13
  },
9
14
  "devDependencies": {
10
- "@prairielearn/tsconfig": "*",
11
- "@types/node": "^18.11.18",
12
- "typescript": "^4.9.4"
15
+ "@prairielearn/tsconfig": "^0.0.0",
16
+ "@types/node": "^18.16.19",
17
+ "typescript": "^5.1.6"
13
18
  },
14
19
  "dependencies": {
15
20
  "logform": "^2.5.1",
16
- "winston": "^3.8.2",
17
- "zod": "^3.20.2"
21
+ "winston": "^3.9.0",
22
+ "zod": "^3.21.4"
18
23
  }
19
24
  }
package/src/index.ts CHANGED
@@ -1,9 +1,9 @@
1
- import winston from 'winston';
1
+ import { createLogger, transports } from 'winston';
2
2
  import { format } from 'logform';
3
3
 
4
- export const logger = winston.createLogger({
4
+ export const logger = createLogger({
5
5
  transports: [
6
- new winston.transports.Console({
6
+ new transports.Console({
7
7
  level: 'info',
8
8
  format: format.combine(format.colorize(), format.simple()),
9
9
  }),
@@ -17,10 +17,10 @@ interface AddFileLoggingOptions {
17
17
 
18
18
  export function addFileLogging(options: AddFileLoggingOptions) {
19
19
  logger.add(
20
- new winston.transports.File({
20
+ new transports.File({
21
21
  filename: options.filename,
22
22
  level: options.level ?? 'debug',
23
23
  format: format.combine(format.timestamp(), format.json()),
24
- })
24
+ }),
25
25
  );
26
26
  }
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "@prairielearn/tsconfig",
2
+ "extends": "@prairielearn/tsconfig/tsconfig.package.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "./dist",
5
5
  "rootDir": "./src",