import {INewrelicConfig, INewrelicObject} from './interfaces'; import {getGlobalConfig, setGlobalConfig} from '../../global'; const {cloneDeep} = require('lodash') let obj: INewrelicConfig | null = null; /** * Setting up config in the singleation, use this function on your application init * @sync * @stable * @param serviceEnv * @param newrelicObj */ export const setNewrelicLoggerConfig = (serviceEnv: string, newrelicObj: INewrelicObject) => { obj = { newrelicObj, serviceEnv } setGlobalConfig(obj, 'newrelicConfig') console.log(obj) } /** * Used to get config from the singleation, mostly used internally * @sync * @stable * @internal */ export const getNewrelicLoggerConfig = ():INewrelicConfig => { return cloneDeep(getGlobalConfig('newrelicConfig')) }