mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Revert "Update spdlog, affects #121513"
This reverts commit 2d2de1920b
.
This commit is contained in:
parent
d09e71dc22
commit
ad576d73db
|
@ -71,7 +71,7 @@
|
|||
"native-watchdog": "1.3.0",
|
||||
"node-pty": "0.10.1",
|
||||
"nsfw": "2.1.2",
|
||||
"spdlog": "0.13.0",
|
||||
"spdlog": "^0.11.1",
|
||||
"sudo-prompt": "9.2.1",
|
||||
"tas-client-umd": "0.1.4",
|
||||
"v8-inspect-profiler": "^0.0.20",
|
||||
|
@ -110,6 +110,7 @@
|
|||
"@types/wicg-file-system-access": "^2020.9.1",
|
||||
"@types/windows-foreground-love": "^0.3.0",
|
||||
"@types/windows-mutex": "^0.4.0",
|
||||
"@types/windows-process-tree": "^0.2.0",
|
||||
"@types/winreg": "^1.2.30",
|
||||
"@types/yauzl": "^2.9.1",
|
||||
"@types/yazl": "^2.4.2",
|
||||
|
|
|
@ -34,7 +34,7 @@ suite('Native Modules (all platforms)', () => {
|
|||
|
||||
test('spdlog', async () => {
|
||||
const spdlog = await import('spdlog');
|
||||
assert.ok(typeof spdlog.createRotatingLoggerSync === 'function', testErrorMessage('spdlog'));
|
||||
assert.ok(typeof spdlog.createRotatingLogger === 'function', testErrorMessage('spdlog'));
|
||||
});
|
||||
|
||||
test('nsfw', async () => {
|
||||
|
|
|
@ -7,20 +7,21 @@ import { LogLevel, ILogger, AbstractMessageLogger } from 'vs/platform/log/common
|
|||
import * as spdlog from 'spdlog';
|
||||
import { ByteSize } from 'vs/platform/files/common/files';
|
||||
|
||||
async function createSpdLogLogger(name: string, logfilePath: string, filesize: number, filecount: number): Promise<spdlog.Logger | null> {
|
||||
async function createSpdLogLogger(name: string, logfilePath: string, filesize: number, filecount: number): Promise<spdlog.RotatingLogger | null> {
|
||||
// Do not crash if spdlog cannot be loaded
|
||||
try {
|
||||
const _spdlog = await import('spdlog');
|
||||
return _spdlog.createAsyncRotatingLogger(name, logfilePath, filesize, filecount);
|
||||
_spdlog.setAsyncMode(8192, 500);
|
||||
return _spdlog.createRotatingLoggerAsync(name, logfilePath, filesize, filecount);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export function createRotatingLogger(name: string, filename: string, filesize: number, filecount: number): spdlog.Logger {
|
||||
export function createRotatingLogger(name: string, filename: string, filesize: number, filecount: number): spdlog.RotatingLogger {
|
||||
const _spdlog: typeof spdlog = require.__$__nodeRequire('spdlog');
|
||||
return _spdlog.createRotatingLoggerSync(name, filename, filesize, filecount);
|
||||
return _spdlog.createRotatingLogger(name, filename, filesize, filecount);
|
||||
}
|
||||
|
||||
interface ILog {
|
||||
|
@ -28,7 +29,7 @@ interface ILog {
|
|||
message: string;
|
||||
}
|
||||
|
||||
function log(logger: spdlog.Logger, level: LogLevel, message: string): void {
|
||||
function log(logger: spdlog.RotatingLogger, level: LogLevel, message: string): void {
|
||||
switch (level) {
|
||||
case LogLevel.Trace: logger.trace(message); break;
|
||||
case LogLevel.Debug: logger.debug(message); break;
|
||||
|
@ -44,7 +45,7 @@ export class SpdLogLogger extends AbstractMessageLogger implements ILogger {
|
|||
|
||||
private buffer: ILog[] = [];
|
||||
private readonly _loggerCreationPromise: Promise<void>;
|
||||
private _logger: spdlog.Logger | undefined;
|
||||
private _logger: spdlog.RotatingLogger | undefined;
|
||||
|
||||
constructor(
|
||||
private readonly name: string,
|
||||
|
|
|
@ -16,13 +16,14 @@ import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
|
|||
import { MutableDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { createRotatingLogger } from 'vs/platform/log/node/spdlogLog';
|
||||
import { Logger } from 'spdlog';
|
||||
import { RotatingLogger } from 'spdlog';
|
||||
import { ByteSize } from 'vs/platform/files/common/files';
|
||||
|
||||
class OutputAppender {
|
||||
private appender: Logger;
|
||||
|
||||
constructor(readonly name: string, readonly file: string) {
|
||||
private appender: RotatingLogger;
|
||||
|
||||
constructor(name: string, readonly file: string) {
|
||||
this.appender = createRotatingLogger(name, file, 30 * ByteSize.MB, 1);
|
||||
this.appender.clearFormatters();
|
||||
}
|
||||
|
|
24
yarn.lock
24
yarn.lock
|
@ -595,6 +595,11 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/windows-mutex/-/windows-mutex-0.4.0.tgz#d27070418aa26047c6c860c704952ff26aeb961b"
|
||||
integrity sha512-zUMH4nutIURLARU6f10Ls6XcZWhUkwmzVEALs26dt1ZbaLv/qxsGdYiePUbwhQmrQUp3EPZ1HxopWpzzC8ot5A==
|
||||
|
||||
"@types/windows-process-tree@^0.2.0":
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/windows-process-tree/-/windows-process-tree-0.2.0.tgz#2fa205c838a8ef0a07697cd747c954653978d22c"
|
||||
integrity sha512-vQAnkWpMX4HUPjubkxKta4Rfh2EDy2ksalnr37gFHNrmk+uxx50PRH+/fM5nTsEBCi4ESFT/7t7Za3jGqyTZ4g==
|
||||
|
||||
"@types/winreg@^1.2.30":
|
||||
version "1.2.30"
|
||||
resolved "https://registry.yarnpkg.com/@types/winreg/-/winreg-1.2.30.tgz#91d6710e536d345b9c9b017c574cf6a8da64c518"
|
||||
|
@ -6328,7 +6333,7 @@ mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3:
|
|||
resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113"
|
||||
integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==
|
||||
|
||||
"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@^0.5.5, mkdirp@~0.5.0, mkdirp@~0.5.1:
|
||||
"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4, mkdirp@~0.5.0, mkdirp@~0.5.1:
|
||||
version "0.5.5"
|
||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
|
||||
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
|
||||
|
@ -6442,11 +6447,16 @@ mute-stream@0.0.8:
|
|||
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
|
||||
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
|
||||
|
||||
nan@^2.12.1, nan@^2.13.2, nan@^2.14.0:
|
||||
nan@^2.12.1, nan@^2.13.2:
|
||||
version "2.14.2"
|
||||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19"
|
||||
integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==
|
||||
|
||||
nan@^2.14.0:
|
||||
version "2.14.0"
|
||||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"
|
||||
integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==
|
||||
|
||||
nanoid@3.1.12:
|
||||
version "3.1.12"
|
||||
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.12.tgz#6f7736c62e8d39421601e4a0c77623a97ea69654"
|
||||
|
@ -8691,13 +8701,13 @@ sparkles@^1.0.0:
|
|||
resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.1.tgz#008db65edce6c50eec0c5e228e1945061dd0437c"
|
||||
integrity sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==
|
||||
|
||||
spdlog@0.13.0:
|
||||
version "0.13.0"
|
||||
resolved "https://registry.yarnpkg.com/spdlog/-/spdlog-0.13.0.tgz#d9424b508928c51b233f0838e5d9f4161106d9a9"
|
||||
integrity sha512-lz82g0f+iG4x7O9RmNpn14vzcPPzumBKx4nrvIw+ZvuGJN+ojWbDbaSPkqJuWZ+Fc1Oxdf5FTGf0iCwW3+pAOw==
|
||||
spdlog@^0.11.1:
|
||||
version "0.11.1"
|
||||
resolved "https://registry.yarnpkg.com/spdlog/-/spdlog-0.11.1.tgz#29721b31018a5fe6a3ce2531f9d8d43e0bd6b825"
|
||||
integrity sha512-M+sg9/Tnr0lrfnW2/hqgpoc4Z8Jzq7W8NUn35iiSslj+1uj1pgutI60MCpulDP2QyFzOpC8VsJmYD6Fub7wHoA==
|
||||
dependencies:
|
||||
bindings "^1.5.0"
|
||||
mkdirp "^0.5.5"
|
||||
mkdirp "^0.5.1"
|
||||
nan "^2.14.0"
|
||||
|
||||
spdx-correct@^3.0.0:
|
||||
|
|
Loading…
Reference in a new issue