{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Resource } from '@opentelemetry/resources';\nimport type { SeverityNumber } from '@opentelemetry/api-logs';\nimport type { InstrumentationScope } from '@opentelemetry/core';\nimport type { MeterProvider } from '@opentelemetry/api';\nimport type { LogRecordProcessor } from './LogRecordProcessor';\n\n/**\n * A LoggerConfig defines various configurable aspects of a Logger's behavior.\n *\n * @experimental This feature is in development as per the OpenTelemetry specification.\n */\nexport interface LoggerConfig {\n  /**\n   * A boolean indication of whether the logger is enabled.\n   * If a Logger is disabled, it behaves equivalently to a No-op Logger.\n   * Defaults to false (loggers are enabled by default).\n   *\n   * @experimental This feature is in development as per the OpenTelemetry specification.\n   */\n  disabled?: boolean;\n\n  /**\n   * A SeverityNumber indicating the minimum severity level for log records to be processed.\n   * If not explicitly set, defaults to 0 (UNSPECIFIED).\n   * Log records with a specified severity (i.e. not 0) that is less than this value will be dropped.\n   * Log records with unspecified severity (0) bypass this filter.\n   *\n   * @experimental This feature is in development as per the OpenTelemetry specification.\n   */\n  minimumSeverity?: SeverityNumber;\n\n  /**\n   * A boolean indication of whether the logger should only process log records\n   * associated with sampled traces.\n   * If not explicitly set, defaults to false.\n   * If true, log records associated with unsampled traces will be dropped.\n   *\n   * @experimental This feature is in development as per the OpenTelemetry specification.\n   */\n  traceBased?: boolean;\n}\n\n/**\n * A LoggerConfigurator is a function which computes the LoggerConfig for a Logger.\n * It is called when a Logger is first created, and for each outstanding Logger\n * when a LoggerProvider's LoggerConfigurator is updated (if updating is supported).\n *\n * The function must return the complete LoggerConfig for the given logger scope.\n * All config properties should have their values computed and set to appropriate defaults.\n *\n * @param loggerScope - The InstrumentationScope of the Logger\n * @returns The computed LoggerConfig with all properties set\n * @experimental This feature is in development as per the OpenTelemetry specification.\n */\nexport type LoggerConfigurator = (\n  loggerScope: InstrumentationScope\n) => Required<LoggerConfig>;\n\nexport interface LoggerProviderConfig {\n  /** Resource associated with trace telemetry  */\n  resource?: Resource;\n\n  /**\n   * How long the forceFlush can run before it is cancelled.\n   * The default value is 30000ms\n   */\n  forceFlushTimeoutMillis?: number;\n\n  /** Log Record Limits*/\n  logRecordLimits?: LogRecordLimits;\n\n  /** Log Record Processors */\n  processors?: LogRecordProcessor[];\n\n  /**\n   * A function that computes the LoggerConfig for a given logger.\n   * This is called when a Logger is first created.\n   *\n   * @experimental This feature is in development as per the OpenTelemetry specification.\n   */\n  loggerConfigurator?: LoggerConfigurator;\n\n  /**\n   * A meter provider to record logs SDK metrics to.\n   * @experimental This option is experimental and is subject to breaking changes in minor releases.\n   */\n  meterProvider?: MeterProvider;\n}\n\nexport interface LogRecordLimits {\n  /** attributeValueLengthLimit is maximum allowed attribute value size */\n  attributeValueLengthLimit?: number;\n\n  /** attributeCountLimit is number of attributes per LogRecord */\n  attributeCountLimit?: number;\n}\n\n/** Interface configuration for a buffer. */\nexport interface BufferConfig {\n  /** The maximum batch size of every export. It must be smaller or equal to\n   * maxQueueSize. The default value is 512. */\n  maxExportBatchSize?: number;\n\n  /** The delay interval in milliseconds between two consecutive exports.\n   *  The default value is 5000ms. */\n  scheduledDelayMillis?: number;\n\n  /** How long the export can run before it is cancelled.\n   * The default value is 30000ms */\n  exportTimeoutMillis?: number;\n\n  /** The maximum queue size. After the size is reached log records are dropped.\n   * The default value is 2048. */\n  maxQueueSize?: number;\n}\n\nexport interface BatchLogRecordProcessorBrowserConfig extends BufferConfig {\n  /** Disable flush when a user navigates to a new page, closes the tab or the browser, or,\n   * on mobile, switches to a different app. Auto flush is enabled by default. */\n  disableAutoFlushOnDocumentHide?: boolean;\n}\n"]}