import { ITelemetryBaseEvent , ITelemetryBaseLogger , ITelemetryErrorEvent , ITelemetryGenericEvent , ITelemetryLogger , ITelemetryPerformanceEvent , } from "@fluidframework/common-definitions" ; /**
 * Null logger
 * It can be used in places where logger instance is required, but events should be not send over.
 */ export class BaseTelemetryNullLogger implements ITelemetryBaseLogger { param event public send ( event ) { return ; } } /**
 * Null logger
 * It can be used in places where logger instance is required, but events should be not send over.
 */ export class TelemetryNullLogger implements ITelemetryLogger { public send ( event ) { } public sendTelemetryEvent ( event , error ? ) { } public sendErrorEvent ( event , error ? ) { } public sendPerformanceEvent ( event , error ? ) { } } export function extractLogSafeErrorProperties ( error ) { const isRegularObject = ( value ) : boolean => { return value !== null && ! Array . isArray ( value ) && typeof value === "object" ; } ; const removeMessageFromStack = ( stack , errorName ? ) => { const stackFrames = stack . split ( "\n" ) ; stackFrames . shift ( ) ; if ( errorName !== undefined ) { stackFrames . unshift ( errorName ) ; } return stackFrames . join ( "\n" ) ; } ; const message = ( typeof error ?. message === "string" ) ? error . message as string : String ( error ) ; const safeProps = { message , } ; if ( isRegularObject ( error ) ) { const { errorType , stack , name } = error ; if ( typeof errorType === "string" ) { safeProps . errorType = errorType ; } if ( typeof stack === "string" ) { const errorName = ( typeof name === "string" ) ? name : undefined ; safeProps . stack = removeMessageFromStack ( stack , errorName ) ; } } return safeProps ; }