Socket
Socket
Sign inDemoInstall

@opentelemetry/api

Package Overview
Dependencies
Maintainers
4
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/api - npm Package Compare versions

Comparing version 0.16.1-alpha.15 to 0.16.1-alpha.20

7

build/src/api/diag.d.ts

@@ -22,6 +22,6 @@ import { DiagLogger, DiagLogFunction } from '../diag/logger';

* Set the DiagLogger instance
* @param logger - The DiagLogger instance to set as the default logger
* @param logger - [Optional] The DiagLogger instance to set as the default logger, if not provided it will set it back as a noop
* @returns The previously registered DiagLogger
*/
setLogger: (logger: DiagLogger) => DiagLogger;
setLogger: (logger?: DiagLogger) => DiagLogger;
/** Set the default maximum diagnostic logging level */

@@ -33,7 +33,4 @@ setLogLevel: (maxLogLevel: DiagLogLevel) => void;

warn: DiagLogFunction;
startupInfo: DiagLogFunction;
error: DiagLogFunction;
critical: DiagLogFunction;
terminal: DiagLogFunction;
}
//# sourceMappingURL=diag.d.ts.map

@@ -62,3 +62,3 @@ "use strict";

var prevLogger = _logger;
if (prevLogger !== logger && logger !== self) {
if (!logger || logger !== self) {
// Simple special case to avoid any possible infinite recursion on the logging functions

@@ -65,0 +65,0 @@ _logger = logger || logger_1.createNoopDiagLogger();

@@ -5,25 +5,9 @@ import { DiagLogger, DiagLogFunction } from './logger';

* If you want to limit the amount of logging to a specific level or lower use the
* {@link diagLogLevelFilter}
* {@link createLogLevelDiagLogger}
*/
export declare class DiagConsoleLogger implements DiagLogger {
constructor();
/**
* Log a terminal situation that would cause the API to completely fail to initialize,
* if this type of message is logged functionality of the API is not expected to be functional.
*/
terminal: DiagLogFunction;
/**
* Log a critical error that NEEDS to be addressed, functionality of the component that emits
* this log detail may non-functional. While the overall API may be.
*/
critical: DiagLogFunction;
/** Log an error scenario that was not expected and caused the requested operation to fail. */
error: DiagLogFunction;
/**
* Logs a general informational message that is used for logging component startup and version
* information without causing additional general informational messages when the logging level
* is set to DiagLogLevel.WARN or lower.
*/
startupInfo: DiagLogFunction;
/**
* Log a warning scenario to inform the developer of an issues that should be investigated.

@@ -30,0 +14,0 @@ * The requested operation may or may not have succeeded or completed.

@@ -20,4 +20,2 @@ "use strict";

var consoleMap = [
{ n: 'terminal', c: 'error' },
{ n: 'critical', c: 'error' },
{ n: 'error', c: 'error' },

@@ -28,3 +26,2 @@ { n: 'warn', c: 'warn' },

{ n: 'verbose', c: 'trace' },
{ n: 'startupInfo', c: 'info' },
];

@@ -34,3 +31,3 @@ /**

* If you want to limit the amount of logging to a specific level or lower use the
* {@link diagLogLevelFilter}
* {@link createLogLevelDiagLogger}
*/

@@ -37,0 +34,0 @@ var DiagConsoleLogger = /** @class */ (function () {

@@ -1,10 +0,1 @@

import { Logger } from '../common/Logger';
/**
* Defines a type which can be used for as a parameter without breaking backward
* compatibility. The {@link Logger} reference will be removed with the removal
* of the Logger definition, this can be used as a replacement for functions
* that are currently passing Logger references during migration to minimize
* breaks that will occur with the removal of the Logger interface.
*/
export declare type OptionalDiagLogger = Logger | DiagLogger | null | undefined;
export declare type DiagLogFunction = (message: string, ...args: unknown[]) => void;

@@ -16,27 +7,9 @@ /**

* - a No-Op {@link createNoopDiagLogger}
* - a {@link DiagLogLevel} filtering wrapper {@link diagLogLevelFilter}
* - a {@link DiagLogLevel} filtering wrapper {@link createLogLevelDiagLogger}
* - a general Console {@link DiagConsoleLogger} version.
*/
export interface DiagLogger {
/**
* Log a terminal situation that would cause the API to completely fail to initialize,
* if this type of message is logged functionality of the API is not expected to be functional.
*/
terminal: DiagLogFunction;
/**
* Log a critical error that NEEDS to be addressed, functionality of the component that emits
* this log detail may be limited or non-functional depending on when this message is emitted.
* Unlike terminal message, it is expected that the overall API may still be functional, again
* depending on what component and when this message is emitted.
*/
critical: DiagLogFunction;
/** Log an error scenario that was not expected and caused the requested operation to fail. */
error: DiagLogFunction;
/**
* Logs a general informational message that is used for logging component startup and version
* information without causing additional general informational messages when the logging level
* is set to DiagLogLevel.WARN or lower.
*/
startupInfo: DiagLogFunction;
/**
* Log a warning scenario to inform the developer of an issues that should be investigated.

@@ -43,0 +16,0 @@ * The requested operation may or may not have succeeded or completed.

@@ -25,6 +25,3 @@ "use strict";

'warn',
'startupInfo',
'error',
'critical',
'terminal',
];

@@ -31,0 +28,0 @@ function noopLogFunction() { }

@@ -10,16 +10,4 @@ import { DiagLogger } from './logger';

NONE = 0,
/**
* Identifies a terminal situation that would cause the API to completely fail to initialize,
* if this type of error is logged functionality of the API is not expected to be functional.
*/
TERMINAL = 10,
/**
* Identifies a critical error that needs to be addressed, functionality of the component
* that emits this log detail may non-functional.
*/
CRITICAL = 20,
/** Identifies an error scenario */
ERROR = 30,
/** Identifies startup and failure (lower) scenarios */
STARTUP = 40,
/** Identifies a warning scenario */

@@ -41,3 +29,3 @@ WARN = 50,

* This is equivalent to:
* type LogLevelString = 'NONE' | TERMINAL' | 'CRITICAL' | 'ERROR' | 'WARN' | 'INFO' | 'DEBUG' | 'VERBOSE' | 'ALL';
* type LogLevelString = 'NONE' | 'ERROR' | 'WARN' | 'INFO' | 'DEBUG' | 'VERBOSE' | 'ALL';
*/

@@ -44,0 +32,0 @@ export declare type DiagLogLevelString = keyof typeof DiagLogLevel;

@@ -30,16 +30,4 @@ "use strict";

DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE";
/**
* Identifies a terminal situation that would cause the API to completely fail to initialize,
* if this type of error is logged functionality of the API is not expected to be functional.
*/
DiagLogLevel[DiagLogLevel["TERMINAL"] = 10] = "TERMINAL";
/**
* Identifies a critical error that needs to be addressed, functionality of the component
* that emits this log detail may non-functional.
*/
DiagLogLevel[DiagLogLevel["CRITICAL"] = 20] = "CRITICAL";
/** Identifies an error scenario */
DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR";
/** Identifies startup and failure (lower) scenarios */
DiagLogLevel[DiagLogLevel["STARTUP"] = 40] = "STARTUP";
/** Identifies a warning scenario */

@@ -59,20 +47,4 @@ DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN";

})(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {}));
/**
* Mapping from DiagLogger function name to Legacy Logger function used if
* the logger instance doesn't have the DiagLogger function
*/
var fallbackLoggerFuncMap = {
terminal: 'error',
critical: 'error',
error: 'error',
warn: 'warn',
info: 'info',
debug: 'debug',
verbose: 'debug',
startupInfo: 'info',
};
/** Mapping from DiagLogger function name to logging level. */
var levelMap = [
{ n: 'terminal', l: DiagLogLevel.TERMINAL },
{ n: 'critical', l: DiagLogLevel.CRITICAL },
{ n: 'error', l: DiagLogLevel.ERROR },

@@ -83,3 +55,2 @@ { n: 'warn', l: DiagLogLevel.WARN },

{ n: 'verbose', l: DiagLogLevel.VERBOSE },
{ n: 'startupInfo', l: DiagLogLevel.ERROR },
];

@@ -117,3 +88,3 @@ /**

var orgArguments = arguments;
var theFunc = theLogger[funcName] || theLogger[fallbackLoggerFuncMap[funcName]];
var theFunc = theLogger[funcName];
if (theFunc && typeof theFunc === 'function') {

@@ -120,0 +91,0 @@ return theFunc.apply(logger, orgArguments);

export * from './common/Exception';
export * from './common/Logger';
export * from './common/Time';

@@ -12,3 +11,2 @@ export * from './context/context';

export * from './trace/link';
export * from './trace/NoopLogger';
export * from './trace/NoopTracer';

@@ -15,0 +13,0 @@ export * from './trace/NoopTracerProvider';

@@ -30,3 +30,2 @@ "use strict";

__exportStar(require("./common/Exception"), exports);
__exportStar(require("./common/Logger"), exports);
__exportStar(require("./common/Time"), exports);

@@ -41,3 +40,2 @@ __exportStar(require("./context/context"), exports);

__exportStar(require("./trace/link"), exports);
__exportStar(require("./trace/NoopLogger"), exports);
__exportStar(require("./trace/NoopTracer"), exports);

@@ -44,0 +42,0 @@ __exportStar(require("./trace/NoopTracerProvider"), exports);

{
"name": "@opentelemetry/api",
"version": "0.16.1-alpha.15+1d682c2f",
"version": "0.16.1-alpha.20+62f8695d",
"description": "Public API for OpenTelemetry",

@@ -79,3 +79,3 @@ "main": "build/src/index.js",

},
"gitHead": "1d682c2f75f9d11265cfc1692fa822174594d4b0"
"gitHead": "62f8695d3fe5309c62418a1043bc6e8a176bc11f"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc