{"version":3,"file":"logging.cjs","sources":["../../../../src/services/dataSource/logging.ts"],"sourcesContent":["import { type DataSourceRef } from '@grafana/data';\nimport { type LogContext } from '@grafana/faro-web-sdk';\n\nimport { TracedError } from '../../utils/TracedError';\nimport { getLogger } from '../logging/registry';\n\nexport function logDataSourceInstanceError(message: string, error: unknown, context?: LogContext): void {\n  getLogger('grafana/runtime.plugins.datasource').logError(new TracedError(message, error), context);\n}\n\nexport function logDataSourceWarning(message: string, context?: LogContext): void {\n  getLogger('grafana/runtime.plugins.datasource').logWarning(message, context);\n}\n\nexport function describeRef(ref: DataSourceRef | string | null | undefined): string {\n  if (ref == null) {\n    return 'default';\n  }\n  if (typeof ref === 'string') {\n    // Faro drops empty attribute values, so give '' a visible label. The synthetic\n    // <empty> marker cannot collide with a real uid/name, unlike a bare word.\n    return ref === '' ? '<empty>' : ref;\n  }\n  // An empty uid falls through to the type so the log still identifies the ref.\n  return ref.uid || ref.type || 'unknown';\n}\n"],"names":["getLogger","TracedError"],"mappings":";;;;;;;;AAMO,SAAS,0BAAA,CAA2B,OAAA,EAAiB,KAAA,EAAgB,OAAA,EAA4B;AACtG,EAAAA,kBAAA,CAAU,oCAAoC,EAAE,QAAA,CAAS,IAAIC,wBAAY,OAAA,EAAS,KAAK,GAAG,OAAO,CAAA;AACnG;AAEO,SAAS,oBAAA,CAAqB,SAAiB,OAAA,EAA4B;AAChF,EAAAD,kBAAA,CAAU,oCAAoC,CAAA,CAAE,UAAA,CAAW,OAAA,EAAS,OAAO,CAAA;AAC7E;AAEO,SAAS,YAAY,GAAA,EAAwD;AAClF,EAAA,IAAI,OAAO,IAAA,EAAM;AACf,IAAA,OAAO,SAAA;AAAA,EACT;AACA,EAAA,IAAI,OAAO,QAAQ,QAAA,EAAU;AAG3B,IAAA,OAAO,GAAA,KAAQ,KAAK,SAAA,GAAY,GAAA;AAAA,EAClC;AAEA,EAAA,OAAO,GAAA,CAAI,GAAA,IAAO,GAAA,CAAI,IAAA,IAAQ,SAAA;AAChC;;;;;;"}