From 3211eb1ce596d9d016c537bfacbb48f475e16571 Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 20 Jan 2021 15:53:11 -0600 Subject: [PATCH] Expose log level to plugins In case they need to map it to something else. --- src/node/plugin.ts | 3 ++- typings/pluginapi.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/node/plugin.ts b/src/node/plugin.ts index ae339cf9f..72f4d0e6c 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -1,4 +1,4 @@ -import { field, Logger } from "@coder/logger" +import { field, Level, Logger } from "@coder/logger" import * as express from "express" import * as fs from "fs" import * as path from "path" @@ -21,6 +21,7 @@ require("module")._load = function (request: string, parent: object, isMain: boo return { express, field, + Level, proxy, WsRouter, } diff --git a/typings/pluginapi.d.ts b/typings/pluginapi.d.ts index e2ba32395..65d5f9afd 100644 --- a/typings/pluginapi.d.ts +++ b/typings/pluginapi.d.ts @@ -1,7 +1,7 @@ /** * This file describes the code-server plugin API for adding new applications. */ -import { field, Logger } from "@coder/logger" +import { field, Level, Logger } from "@coder/logger" import * as express from "express" import * as expressCore from "express-serve-static-core" import ProxyServer from "http-proxy" @@ -116,7 +116,7 @@ export { express } * * Re-exported so plugins don't have to import duplicate copies of the logger. */ -export { field } +export { field, Level } export const proxy: ProxyServer