configureLogging (logging/logger.ts)

harness-sdk · strands-ts/src/logging/logger.ts · typescript · Apache-2.0
infra, tag:knn-classified

Sets a global logger instance, allowing injection of custom loggers.

// Source: https://github.com/strands-agents/harness-sdk | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Logger configuration.
 *
 * This module provides simple logging infrastructure for the Strands SDK.
 * Users can inject their own logger implementation to control logging behavior.
 */

import type { Logger } from './types.js'

/**
 * Default logger implementation.
 *
 * Only logs warnings and errors to console. Debug and info are no-ops.
 */
const defaultLogger: Logger = {
  debug: () => {},
  info: () => {},
  warn: (...args: unknown[]) => console.warn(...args),
  error: (...args: unknown[]) => console.error(...args),
}

/**
 * Global logger instance.
 */
export let logger: Logger = defaultLogger

/**
 * Configures the global logger.
 *
 *

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key