diff --git a/package.json b/package.json index 5baee5dd59c8c04ec14f16eed3c6c37d7605c18a..3b5d6faf2bfe9d7b814b65ccc860d53061b42695 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "nsfw": "1.2.5", "onigasm-umd": "^2.2.2", "semver-umd": "^5.5.3", - "spdlog": "^0.11.1", + "spdlog": "^0.9.0", "sudo-prompt": "9.0.0", "v8-inspect-profiler": "^0.0.20", "vscode-minimist": "^1.2.1", diff --git a/src/typings/spdlog.d.ts b/src/typings/spdlog.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bf6bb9c3dfdd4a191f76fd20963b79123777068a --- /dev/null +++ b/src/typings/spdlog.d.ts @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +declare module 'spdlog' { + + export const version: string; + export function setAsyncMode(bufferSize: number, flushInterval: number): void; + export function createRotatingLogger(name: string, filename: string, filesize: number, filecount: number): RotatingLogger; + export function createRotatingLoggerAsync(name: string, filename: string, filesize: number, filecount: number): Promise; + + export enum LogLevel { + CRITICAL, + ERROR, + WARN, + INFO, + DEBUG, + TRACE, + OFF + } + + export class RotatingLogger { + constructor(name: string, filename: string, filesize: number, filecount: number); + + trace(message: string): void; + debug(message: string): void; + info(message: string): void; + warn(message: string): void; + error(message: string): void; + critical(message: string): void; + setLevel(level: number): void; + clearFormatters(): void; + /** + * A synchronous operation to flush the contents into file + */ + flush(): void; + drop(): void; + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 49346cb3369d75d509bbe28cd6a3ca55ab47f06a..689fa1f047ffb215a4a8e56661ca5d708cc6c9d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7782,10 +7782,10 @@ sparkles@^1.0.0: resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3" integrity sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM= -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== +spdlog@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/spdlog/-/spdlog-0.9.0.tgz#c85dd9d0b9cd385f6f3f5b92dc9d2e1691092b5c" + integrity sha512-AeLWPCYjGi4w5DfpXFKb9pCdgMe4gFBMroGfgwXiNfzwmcNYGoFQkIuD1MChZBR1Iwrx0nGhsTSHFslt/qfTAQ== dependencies: bindings "^1.5.0" mkdirp "^0.5.1"