commit
a8e2a2114d
4 changed files with 18 additions and 4 deletions
|
|
@ -78,6 +78,12 @@ export const getLogger = (params: LoggerParams): PubLogger => {
|
||||||
}
|
}
|
||||||
toLog.push(params.appName)
|
toLog.push(params.appName)
|
||||||
}
|
}
|
||||||
|
if (params.component) {
|
||||||
|
if (disabledComponents.includes(params.component)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
toLog.push(params.component)
|
||||||
|
}
|
||||||
if (params.userId) {
|
if (params.userId) {
|
||||||
toLog.push(params.userId)
|
toLog.push(params.userId)
|
||||||
}
|
}
|
||||||
|
|
@ -87,7 +93,13 @@ export const getLogger = (params: LoggerParams): PubLogger => {
|
||||||
writers.forEach(w => w(final))
|
writers.forEach(w => w(final))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const disabledApps: string[] = []
|
let disabledApps: string[] = []
|
||||||
export const disableLoggers = (appNamesToDisable: string[]) => {
|
let disabledComponents: string[] = []
|
||||||
|
export const resetDisabledLoggers = () => {
|
||||||
|
disabledApps = []
|
||||||
|
disabledComponents = []
|
||||||
|
}
|
||||||
|
export const disableLoggers = (appNamesToDisable: string[], componentsToDisable: string[]) => {
|
||||||
disabledApps.push(...appNamesToDisable)
|
disabledApps.push(...appNamesToDisable)
|
||||||
|
disabledComponents.push(...componentsToDisable)
|
||||||
}
|
}
|
||||||
|
|
@ -4,7 +4,7 @@ import { Describe, expect, expectThrowsAsync, runSanityCheck, safelySetUserBalan
|
||||||
export const ignore = false
|
export const ignore = false
|
||||||
|
|
||||||
export default async (T: TestBase) => {
|
export default async (T: TestBase) => {
|
||||||
disableLoggers(["EventsLogManager", "htlcTracker", "watchdog"])
|
disableLoggers([], ["EventsLogManager", "htlcTracker", "watchdog"])
|
||||||
await safelySetUserBalance(T, T.user1, 2000)
|
await safelySetUserBalance(T, T.user1, 2000)
|
||||||
await testSpamExternalPayment(T)
|
await testSpamExternalPayment(T)
|
||||||
await runSanityCheck(T)
|
await runSanityCheck(T)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import * as Types from '../../proto/autogenerated/ts/types.js'
|
||||||
export const ignore = false
|
export const ignore = false
|
||||||
|
|
||||||
export default async (T: TestBase) => {
|
export default async (T: TestBase) => {
|
||||||
disableLoggers(["EventsLogManager", "htlcTracker", "watchdog"])
|
disableLoggers([], ["EventsLogManager", "htlcTracker", "watchdog"])
|
||||||
await safelySetUserBalance(T, T.user1, 2000)
|
await safelySetUserBalance(T, T.user1, 2000)
|
||||||
await testSpamExternalPayment(T)
|
await testSpamExternalPayment(T)
|
||||||
await runSanityCheck(T)
|
await runSanityCheck(T)
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import chaiString from 'chai-string'
|
||||||
import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js'
|
import { defaultInvoiceExpiry } from '../services/storage/paymentStorage.js'
|
||||||
import SanityChecker from '../services/main/sanityChecker.js'
|
import SanityChecker from '../services/main/sanityChecker.js'
|
||||||
import LND from '../services/lnd/lnd.js'
|
import LND from '../services/lnd/lnd.js'
|
||||||
|
import { resetDisabledLoggers } from '../services/helpers/logger.js'
|
||||||
chai.use(chaiString)
|
chai.use(chaiString)
|
||||||
export const expect = chai.expect
|
export const expect = chai.expect
|
||||||
export type Describe = (message: string, failure?: boolean) => void
|
export type Describe = (message: string, failure?: boolean) => void
|
||||||
|
|
@ -69,6 +70,7 @@ export const teardown = async (T: TestBase) => {
|
||||||
T.externalAccessToMainLnd.Stop()
|
T.externalAccessToMainLnd.Stop()
|
||||||
T.externalAccessToOtherLnd.Stop()
|
T.externalAccessToOtherLnd.Stop()
|
||||||
T.externalAccessToThirdLnd.Stop()
|
T.externalAccessToThirdLnd.Stop()
|
||||||
|
resetDisabledLoggers()
|
||||||
console.log("teardown")
|
console.log("teardown")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue