Skip to content

Commit

Permalink
feat: aPI Fixes (dummy change to force minor version)
Browse files Browse the repository at this point in the history
  • Loading branch information
bd82 committed Jan 14, 2020
1 parent ec30457 commit 0fb0fb6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 41 deletions.
14 changes: 9 additions & 5 deletions packages/logger/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,20 @@ export function getExtensionLogger(

export type getExtensionLoggerOpts = {
/**
* Root Label used when creating log entries.
* This will also be used as the prefix label for any childLogger e.g:
* - "Root.child"
* - "Root.child.grandChild"
* This parameter will be used for two things:
*
* - Name of the VSCode OutputChannel to log to.
*
* - Root Label used when creating log entries.
* This will also be used as the prefix label for any childLogger e.g:
* - "Root.child"
* - "Root.child.grandChild"
*/
extName: string;
/**
* The Initial Log Level to use.
* This should normally provided by a configuration setting exposed to the Extension's end-users.
* - See: https://github.com/SAP/vscode-logging/tree/master/examples for a runnable example
* - See: https://github.com/SAP/vscode-logging/tree/master/examples/extension for a runnable example
* exposing logging configuration to the end user.
*/
level: LogLevel;
Expand Down
38 changes: 2 additions & 36 deletions packages/types/api.d.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,6 @@
type LogLevel = "off" | "fatal" | "error" | "warn" | "info" | "debug" | "trace";

export type getExtensionLoggerOpts = {
/**
* Root Label used when creating log entries.
* This will also be used as the prefix label for any childLogger e.g:
* - "Root.child"
* - "Root.child.grandChild"
*/
extName: string;
/**
* The Initial Log Level to use.
* This should normally provided by a configuration setting exposed to the Extension's end-users.
* - See the examples directory in the root of this repo.
*/
level: LogLevel;
/**
* Optional directory where the rolling log files should be kept.
* If this is not passed no rolling File Logs will be used.
*
* If the directory does not exist it would be created.
*
* It is normally expected to send the `ExtensionContext.logPath` in the parameter,
* - https://code.visualstudio.com/api/references/vscode-api#ExtensionContext.logPath
* which means `getExtensionLogger` should be called from the Extension's main `activate` function.
* - https://code.visualstudio.com/api/references/activation-events#Start-up
*/
logPath?: string;
/**
* Flag for adding sourceLocation information to each logEntry.
* This is disabled by default and should only be enabled during debugging flows as it
* Will likely cause significant performance regressions in productive flows.
*/
sourceLocationTracking?: boolean;
};

interface IVSCodeExtLogger extends IChildLogger {
export interface IVSCodeExtLogger extends IChildLogger {
/**
* Modify the Logging Level.
* This will affect all child loggers as well.
Expand All @@ -48,7 +14,7 @@ interface IVSCodeExtLogger extends IChildLogger {
changeSourceLocationTracking(newSourceLocation: boolean): void;
}

interface IChildLogger {
export interface IChildLogger {
/**
* @param msg - The Message to log, It may include format specifiers as defined in
* - https://nodejs.org/api/util.html#util_util_format_format_args
Expand Down

0 comments on commit 0fb0fb6

Please sign in to comment.