mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-14 16:10:59 -07:00
25 lines
556 B
TypeScript
25 lines
556 B
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import * as vscode from 'vscode';
|
|
|
|
export function createLogger(
|
|
context: vscode.ExtensionContext,
|
|
logger: vscode.OutputChannel,
|
|
) {
|
|
return (message: string) => {
|
|
const isDevMode =
|
|
context.extensionMode === vscode.ExtensionMode.Development;
|
|
const isLoggingEnabled = vscode.workspace
|
|
.getConfiguration('gemini-cli.debug')
|
|
.get('logging.enabled');
|
|
|
|
if (isDevMode || isLoggingEnabled) {
|
|
logger.appendLine(message);
|
|
}
|
|
};
|
|
}
|