standard-log 8.0.1 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (613) hide show
  1. package/README.md +57 -133
  2. package/{esm/console/createConsoleLogReporter.d.ts → cjs/console.d.ts} +5 -5
  3. package/cjs/console.d.ts.map +1 -0
  4. package/cjs/console.js +76 -0
  5. package/cjs/console.js.map +1 -0
  6. package/cjs/console.spec.d.ts +2 -0
  7. package/cjs/console.spec.d.ts.map +1 -0
  8. package/cjs/{console/createConsoleLogReporter.spec.js → console.spec.js} +50 -68
  9. package/cjs/console.spec.js.map +1 -0
  10. package/cjs/errors.d.ts +0 -10
  11. package/cjs/errors.d.ts.map +1 -1
  12. package/cjs/errors.js +1 -43
  13. package/cjs/errors.js.map +1 -1
  14. package/cjs/formatter.d.ts +6 -0
  15. package/cjs/formatter.d.ts.map +1 -0
  16. package/cjs/formatter.js +46 -0
  17. package/cjs/formatter.js.map +1 -0
  18. package/cjs/formatter.spec.d.ts +2 -0
  19. package/cjs/formatter.spec.d.ts.map +1 -0
  20. package/cjs/formatter.spec.js +32 -0
  21. package/cjs/formatter.spec.js.map +1 -0
  22. package/cjs/index.d.ts +5 -14
  23. package/cjs/index.d.ts.map +1 -1
  24. package/cjs/index.js +5 -14
  25. package/cjs/index.js.map +1 -1
  26. package/cjs/logLevels.d.ts +60 -0
  27. package/cjs/logLevels.d.ts.map +1 -0
  28. package/cjs/logLevels.js +87 -0
  29. package/cjs/logLevels.js.map +1 -0
  30. package/cjs/logStore.d.ts +20 -0
  31. package/cjs/logStore.d.ts.map +1 -0
  32. package/cjs/logStore.js +44 -0
  33. package/cjs/logStore.js.map +1 -0
  34. package/cjs/logStore.spec.d.ts +2 -0
  35. package/cjs/logStore.spec.d.ts.map +1 -0
  36. package/cjs/logStore.spec.js +93 -0
  37. package/cjs/logStore.spec.js.map +1 -0
  38. package/cjs/logger.d.ts +6 -0
  39. package/cjs/logger.d.ts.map +1 -0
  40. package/cjs/logger.js +97 -0
  41. package/cjs/logger.js.map +1 -0
  42. package/{esm/memory/MemoryLogReporter.d.ts → cjs/memory.d.ts} +2 -2
  43. package/cjs/memory.d.ts.map +1 -0
  44. package/cjs/memory.js +39 -0
  45. package/cjs/memory.js.map +1 -0
  46. package/cjs/memory.spec.d.ts +2 -0
  47. package/cjs/memory.spec.d.ts.map +1 -0
  48. package/cjs/memory.spec.js +115 -0
  49. package/cjs/memory.spec.js.map +1 -0
  50. package/cjs/package.json +1 -3
  51. package/cjs/platform.browser.d.ts +7 -0
  52. package/cjs/platform.browser.d.ts.map +1 -0
  53. package/cjs/platform.browser.js +11 -0
  54. package/cjs/platform.browser.js.map +1 -0
  55. package/cjs/platform.d.ts +8 -0
  56. package/cjs/platform.d.ts.map +1 -0
  57. package/cjs/platform.js +26 -0
  58. package/cjs/platform.js.map +1 -0
  59. package/cjs/platform.spec.d.ts +2 -0
  60. package/cjs/platform.spec.d.ts.map +1 -0
  61. package/cjs/platform.spec.js +22 -0
  62. package/cjs/platform.spec.js.map +1 -0
  63. package/cjs/standardLog.d.ts +21 -0
  64. package/cjs/standardLog.d.ts.map +1 -0
  65. package/cjs/standardLog.js +59 -0
  66. package/cjs/standardLog.js.map +1 -0
  67. package/cjs/standardLog.spec.d.ts +2 -0
  68. package/cjs/standardLog.spec.d.ts.map +1 -0
  69. package/cjs/standardLog.spec.js +536 -0
  70. package/cjs/standardLog.spec.js.map +1 -0
  71. package/cjs/testUtil.d.ts +7 -5
  72. package/cjs/testUtil.d.ts.map +1 -1
  73. package/cjs/testUtil.js +11 -14
  74. package/cjs/testUtil.js.map +1 -1
  75. package/cjs/types.d.ts +33 -24
  76. package/cjs/types.d.ts.map +1 -1
  77. package/cjs/types.js.map +1 -1
  78. package/dist/standard-log.es5.js +324 -1078
  79. package/dist/standard-log.es5.js.gz +0 -0
  80. package/dist/standard-log.es5.js.map +1 -1
  81. package/dist/standard-log.es5.js.map.gz +0 -0
  82. package/dist/standard-log.esm.js +307 -1145
  83. package/dist/standard-log.esm.js.gz +0 -0
  84. package/dist/standard-log.esm.js.map +1 -1
  85. package/dist/standard-log.esm.js.map.gz +0 -0
  86. package/{cjs/console/createConsoleLogReporter.d.ts → esm/console.d.ts} +5 -5
  87. package/esm/console.d.ts.map +1 -0
  88. package/esm/{console/polyfilledConsole.js → console.js} +36 -4
  89. package/esm/console.js.map +1 -0
  90. package/esm/console.spec.d.ts +2 -0
  91. package/esm/console.spec.d.ts.map +1 -0
  92. package/esm/{console/createConsoleLogReporter.spec.js → console.spec.js} +50 -65
  93. package/esm/console.spec.js.map +1 -0
  94. package/esm/errors.d.ts +0 -10
  95. package/esm/errors.d.ts.map +1 -1
  96. package/esm/errors.js +0 -34
  97. package/esm/errors.js.map +1 -1
  98. package/esm/formatter.d.ts +6 -0
  99. package/esm/formatter.d.ts.map +1 -0
  100. package/esm/{formatter/createTimestampFormatter.js → formatter.js} +10 -2
  101. package/esm/formatter.js.map +1 -0
  102. package/esm/formatter.spec.d.ts +2 -0
  103. package/esm/formatter.spec.d.ts.map +1 -0
  104. package/esm/formatter.spec.js +30 -0
  105. package/esm/formatter.spec.js.map +1 -0
  106. package/esm/index.d.ts +5 -14
  107. package/esm/index.d.ts.map +1 -1
  108. package/esm/index.js +5 -14
  109. package/esm/index.js.map +1 -1
  110. package/esm/logLevels.d.ts +60 -0
  111. package/esm/logLevels.d.ts.map +1 -0
  112. package/esm/{logLevel.js → logLevels.js} +29 -3
  113. package/esm/logLevels.js.map +1 -0
  114. package/esm/logStore.d.ts +20 -0
  115. package/esm/logStore.d.ts.map +1 -0
  116. package/esm/logStore.js +37 -0
  117. package/esm/logStore.js.map +1 -0
  118. package/esm/logStore.spec.d.ts +2 -0
  119. package/esm/logStore.spec.d.ts.map +1 -0
  120. package/esm/logStore.spec.js +93 -0
  121. package/esm/logStore.spec.js.map +1 -0
  122. package/esm/logger.d.ts +6 -0
  123. package/esm/logger.d.ts.map +1 -0
  124. package/esm/logger.js +74 -0
  125. package/esm/logger.js.map +1 -0
  126. package/{cjs/memory/MemoryLogReporter.d.ts → esm/memory.d.ts} +2 -2
  127. package/esm/memory.d.ts.map +1 -0
  128. package/esm/memory.js +34 -0
  129. package/esm/memory.js.map +1 -0
  130. package/esm/memory.spec.d.ts +2 -0
  131. package/esm/memory.spec.d.ts.map +1 -0
  132. package/esm/memory.spec.js +110 -0
  133. package/esm/memory.spec.js.map +1 -0
  134. package/esm/platform.browser.d.ts +7 -0
  135. package/esm/platform.browser.d.ts.map +1 -0
  136. package/esm/platform.browser.js +6 -0
  137. package/esm/platform.browser.js.map +1 -0
  138. package/esm/platform.d.ts +8 -0
  139. package/esm/platform.d.ts.map +1 -0
  140. package/esm/platform.js +20 -0
  141. package/esm/platform.js.map +1 -0
  142. package/esm/platform.spec.d.ts +2 -0
  143. package/esm/platform.spec.d.ts.map +1 -0
  144. package/esm/{console/semverGt.spec.js → platform.spec.js} +2 -2
  145. package/esm/platform.spec.js.map +1 -0
  146. package/esm/standardLog.d.ts +21 -0
  147. package/esm/standardLog.d.ts.map +1 -0
  148. package/esm/standardLog.js +36 -0
  149. package/esm/standardLog.js.map +1 -0
  150. package/esm/standardLog.spec.d.ts +2 -0
  151. package/esm/standardLog.spec.d.ts.map +1 -0
  152. package/esm/standardLog.spec.js +434 -0
  153. package/esm/standardLog.spec.js.map +1 -0
  154. package/esm/testUtil.d.ts +7 -5
  155. package/esm/testUtil.d.ts.map +1 -1
  156. package/esm/testUtil.js +8 -12
  157. package/esm/testUtil.js.map +1 -1
  158. package/esm/types.d.ts +33 -24
  159. package/esm/types.d.ts.map +1 -1
  160. package/esm/types.js.map +1 -1
  161. package/package.json +10 -19
  162. package/ts/console.ts +72 -0
  163. package/ts/errors.ts +0 -12
  164. package/ts/{formatter/createTimestampFormatter.ts → formatter.ts} +12 -1
  165. package/ts/index.ts +5 -14
  166. package/ts/{logLevel.ts → logLevels.ts} +20 -3
  167. package/ts/logStore.ts +52 -0
  168. package/ts/logger.ts +85 -0
  169. package/ts/memory.ts +47 -0
  170. package/ts/platform.browser.ts +8 -0
  171. package/ts/platform.ts +25 -0
  172. package/ts/standardLog.ts +54 -0
  173. package/ts/types.ts +39 -30
  174. package/cjs/LogEntry.d.ts +0 -7
  175. package/cjs/LogEntry.d.ts.map +0 -1
  176. package/cjs/LogEntry.js +0 -3
  177. package/cjs/LogEntry.js.map +0 -1
  178. package/cjs/captureLogs.d.ts +0 -4
  179. package/cjs/captureLogs.d.ts.map +0 -1
  180. package/cjs/captureLogs.js +0 -33
  181. package/cjs/captureLogs.js.map +0 -1
  182. package/cjs/captureLogs.spec.d.ts +0 -2
  183. package/cjs/captureLogs.spec.d.ts.map +0 -1
  184. package/cjs/captureLogs.spec.js +0 -117
  185. package/cjs/captureLogs.spec.js.map +0 -1
  186. package/cjs/config.d.ts +0 -12
  187. package/cjs/config.d.ts.map +0 -1
  188. package/cjs/config.js +0 -59
  189. package/cjs/config.js.map +0 -1
  190. package/cjs/config.spec.d.ts +0 -2
  191. package/cjs/config.spec.d.ts.map +0 -1
  192. package/cjs/config.spec.js +0 -72
  193. package/cjs/config.spec.js.map +0 -1
  194. package/cjs/configForTest.d.ts +0 -5
  195. package/cjs/configForTest.d.ts.map +0 -1
  196. package/cjs/configForTest.js +0 -18
  197. package/cjs/configForTest.js.map +0 -1
  198. package/cjs/configForTest.spec.d.ts +0 -2
  199. package/cjs/configForTest.spec.d.ts.map +0 -1
  200. package/cjs/configForTest.spec.js +0 -17
  201. package/cjs/configForTest.spec.js.map +0 -1
  202. package/cjs/console/createConsoleLogReporter.d.ts.map +0 -1
  203. package/cjs/console/createConsoleLogReporter.js +0 -42
  204. package/cjs/console/createConsoleLogReporter.js.map +0 -1
  205. package/cjs/console/createConsoleLogReporter.spec.d.ts +0 -2
  206. package/cjs/console/createConsoleLogReporter.spec.d.ts.map +0 -1
  207. package/cjs/console/createConsoleLogReporter.spec.js.map +0 -1
  208. package/cjs/console/index.d.ts +0 -4
  209. package/cjs/console/index.d.ts.map +0 -1
  210. package/cjs/console/index.js +0 -20
  211. package/cjs/console/index.js.map +0 -1
  212. package/cjs/console/isConsoleDebugAvailable.d.ts +0 -2
  213. package/cjs/console/isConsoleDebugAvailable.d.ts.map +0 -1
  214. package/cjs/console/isConsoleDebugAvailable.js +0 -20
  215. package/cjs/console/isConsoleDebugAvailable.js.map +0 -1
  216. package/cjs/console/polyfilledConsole.d.ts +0 -7
  217. package/cjs/console/polyfilledConsole.d.ts.map +0 -1
  218. package/cjs/console/polyfilledConsole.js +0 -41
  219. package/cjs/console/polyfilledConsole.js.map +0 -1
  220. package/cjs/console/semverGt.d.ts +0 -2
  221. package/cjs/console/semverGt.d.ts.map +0 -1
  222. package/cjs/console/semverGt.js +0 -13
  223. package/cjs/console/semverGt.js.map +0 -1
  224. package/cjs/console/semverGt.spec.d.ts +0 -2
  225. package/cjs/console/semverGt.spec.d.ts.map +0 -1
  226. package/cjs/console/semverGt.spec.js +0 -22
  227. package/cjs/console/semverGt.spec.js.map +0 -1
  228. package/cjs/console/toConsoleMethod.d.ts +0 -2
  229. package/cjs/console/toConsoleMethod.d.ts.map +0 -1
  230. package/cjs/console/toConsoleMethod.js +0 -22
  231. package/cjs/console/toConsoleMethod.js.map +0 -1
  232. package/cjs/console/types.d.ts +0 -3
  233. package/cjs/console/types.d.ts.map +0 -1
  234. package/cjs/console/types.js +0 -3
  235. package/cjs/console/types.js.map +0 -1
  236. package/cjs/customLogLevel.d.ts +0 -11
  237. package/cjs/customLogLevel.d.ts.map +0 -1
  238. package/cjs/customLogLevel.js +0 -38
  239. package/cjs/customLogLevel.js.map +0 -1
  240. package/cjs/customLogLevel.spec.d.ts +0 -2
  241. package/cjs/customLogLevel.spec.d.ts.map +0 -1
  242. package/cjs/customLogLevel.spec.js +0 -37
  243. package/cjs/customLogLevel.spec.js.map +0 -1
  244. package/cjs/formatter/createTimestampFormatter.d.ts +0 -3
  245. package/cjs/formatter/createTimestampFormatter.d.ts.map +0 -1
  246. package/cjs/formatter/createTimestampFormatter.js +0 -26
  247. package/cjs/formatter/createTimestampFormatter.js.map +0 -1
  248. package/cjs/formatter/createTimestampFormatter.spec.d.ts +0 -2
  249. package/cjs/formatter/createTimestampFormatter.spec.d.ts.map +0 -1
  250. package/cjs/formatter/createTimestampFormatter.spec.js +0 -23
  251. package/cjs/formatter/createTimestampFormatter.spec.js.map +0 -1
  252. package/cjs/formatter/formatLogLevel.d.ts +0 -2
  253. package/cjs/formatter/formatLogLevel.d.ts.map +0 -1
  254. package/cjs/formatter/formatLogLevel.js +0 -10
  255. package/cjs/formatter/formatLogLevel.js.map +0 -1
  256. package/cjs/formatter/index.d.ts +0 -4
  257. package/cjs/formatter/index.d.ts.map +0 -1
  258. package/cjs/formatter/index.js +0 -20
  259. package/cjs/formatter/index.js.map +0 -1
  260. package/cjs/formatter/plainLogFormatter.d.ts +0 -3
  261. package/cjs/formatter/plainLogFormatter.d.ts.map +0 -1
  262. package/cjs/formatter/plainLogFormatter.js +0 -19
  263. package/cjs/formatter/plainLogFormatter.js.map +0 -1
  264. package/cjs/formatter/plainLogFormatter.spec.d.ts +0 -2
  265. package/cjs/formatter/plainLogFormatter.spec.d.ts.map +0 -1
  266. package/cjs/formatter/plainLogFormatter.spec.js +0 -9
  267. package/cjs/formatter/plainLogFormatter.spec.js.map +0 -1
  268. package/cjs/getDefaultReporter.browser.d.ts +0 -2
  269. package/cjs/getDefaultReporter.browser.d.ts.map +0 -1
  270. package/cjs/getDefaultReporter.browser.js +0 -15
  271. package/cjs/getDefaultReporter.browser.js.map +0 -1
  272. package/cjs/getDefaultReporter.d.ts +0 -2
  273. package/cjs/getDefaultReporter.d.ts.map +0 -1
  274. package/cjs/getDefaultReporter.js +0 -19
  275. package/cjs/getDefaultReporter.js.map +0 -1
  276. package/cjs/getLogModeFromEnvironment.browser.d.ts +0 -3
  277. package/cjs/getLogModeFromEnvironment.browser.d.ts.map +0 -1
  278. package/cjs/getLogModeFromEnvironment.browser.js +0 -9
  279. package/cjs/getLogModeFromEnvironment.browser.js.map +0 -1
  280. package/cjs/getLogModeFromEnvironment.d.ts +0 -3
  281. package/cjs/getLogModeFromEnvironment.d.ts.map +0 -1
  282. package/cjs/getLogModeFromEnvironment.js +0 -17
  283. package/cjs/getLogModeFromEnvironment.js.map +0 -1
  284. package/cjs/getLogModeFromEnvironment.spec.d.ts +0 -2
  285. package/cjs/getLogModeFromEnvironment.spec.d.ts.map +0 -1
  286. package/cjs/getLogModeFromEnvironment.spec.js +0 -25
  287. package/cjs/getLogModeFromEnvironment.spec.js.map +0 -1
  288. package/cjs/getLogger.d.ts +0 -9
  289. package/cjs/getLogger.d.ts.map +0 -1
  290. package/cjs/getLogger.js +0 -103
  291. package/cjs/getLogger.js.map +0 -1
  292. package/cjs/getLogger.spec.d.ts +0 -2
  293. package/cjs/getLogger.spec.d.ts.map +0 -1
  294. package/cjs/getLogger.spec.js +0 -485
  295. package/cjs/getLogger.spec.js.map +0 -1
  296. package/cjs/getLoggers.d.ts +0 -7
  297. package/cjs/getLoggers.d.ts.map +0 -1
  298. package/cjs/getLoggers.js +0 -15
  299. package/cjs/getLoggers.js.map +0 -1
  300. package/cjs/logLevel.d.ts +0 -106
  301. package/cjs/logLevel.d.ts.map +0 -1
  302. package/cjs/logLevel.js +0 -59
  303. package/cjs/logLevel.js.map +0 -1
  304. package/cjs/logLevel.spec.d.ts +0 -2
  305. package/cjs/logLevel.spec.d.ts.map +0 -1
  306. package/cjs/logLevel.spec.js +0 -195
  307. package/cjs/logLevel.spec.js.map +0 -1
  308. package/cjs/logLevelFn.d.ts +0 -20
  309. package/cjs/logLevelFn.d.ts.map +0 -1
  310. package/cjs/logLevelFn.js +0 -76
  311. package/cjs/logLevelFn.js.map +0 -1
  312. package/cjs/logReporter.d.ts +0 -7
  313. package/cjs/logReporter.d.ts.map +0 -1
  314. package/cjs/logReporter.js +0 -29
  315. package/cjs/logReporter.js.map +0 -1
  316. package/cjs/logReporter.spec.d.ts +0 -2
  317. package/cjs/logReporter.spec.d.ts.map +0 -1
  318. package/cjs/logReporter.spec.js +0 -98
  319. package/cjs/logReporter.spec.js.map +0 -1
  320. package/cjs/logReporterInternal.d.ts +0 -3
  321. package/cjs/logReporterInternal.d.ts.map +0 -1
  322. package/cjs/logReporterInternal.js +0 -23
  323. package/cjs/logReporterInternal.js.map +0 -1
  324. package/cjs/memory/MemoryLogReporter.d.ts.map +0 -1
  325. package/cjs/memory/MemoryLogReporter.js +0 -56
  326. package/cjs/memory/MemoryLogReporter.js.map +0 -1
  327. package/cjs/memory/MemoryLogReporter.spec.d.ts +0 -2
  328. package/cjs/memory/MemoryLogReporter.spec.d.ts.map +0 -1
  329. package/cjs/memory/MemoryLogReporter.spec.js +0 -124
  330. package/cjs/memory/MemoryLogReporter.spec.js.map +0 -1
  331. package/cjs/memory/index.d.ts +0 -3
  332. package/cjs/memory/index.d.ts.map +0 -1
  333. package/cjs/memory/index.js +0 -19
  334. package/cjs/memory/index.js.map +0 -1
  335. package/cjs/memory/logEntriesToString.d.ts +0 -3
  336. package/cjs/memory/logEntriesToString.d.ts.map +0 -1
  337. package/cjs/memory/logEntriesToString.js +0 -10
  338. package/cjs/memory/logEntriesToString.js.map +0 -1
  339. package/cjs/memory/logEntriesToString.spec.d.ts +0 -2
  340. package/cjs/memory/logEntriesToString.spec.d.ts.map +0 -1
  341. package/cjs/memory/logEntriesToString.spec.js +0 -36
  342. package/cjs/memory/logEntriesToString.spec.js.map +0 -1
  343. package/cjs/memory/toInspectStringForObject.d.ts +0 -3
  344. package/cjs/memory/toInspectStringForObject.d.ts.map +0 -1
  345. package/cjs/memory/toInspectStringForObject.js +0 -17
  346. package/cjs/memory/toInspectStringForObject.js.map +0 -1
  347. package/cjs/shouldLog.d.ts +0 -8
  348. package/cjs/shouldLog.d.ts.map +0 -1
  349. package/cjs/shouldLog.js +0 -14
  350. package/cjs/shouldLog.js.map +0 -1
  351. package/cjs/store.d.ts +0 -3
  352. package/cjs/store.d.ts.map +0 -1
  353. package/cjs/store.js +0 -27
  354. package/cjs/store.js.map +0 -1
  355. package/cjs/suppressLogs.d.ts +0 -6
  356. package/cjs/suppressLogs.d.ts.map +0 -1
  357. package/cjs/suppressLogs.js +0 -17
  358. package/cjs/suppressLogs.js.map +0 -1
  359. package/cjs/suppressLogs.spec.d.ts +0 -2
  360. package/cjs/suppressLogs.spec.d.ts.map +0 -1
  361. package/cjs/suppressLogs.spec.js +0 -31
  362. package/cjs/suppressLogs.spec.js.map +0 -1
  363. package/cjs/typesInternal.d.ts +0 -20
  364. package/cjs/typesInternal.d.ts.map +0 -1
  365. package/cjs/typesInternal.js +0 -3
  366. package/cjs/typesInternal.js.map +0 -1
  367. package/cjs/utils.d.ts +0 -6
  368. package/cjs/utils.d.ts.map +0 -1
  369. package/cjs/utils.js +0 -15
  370. package/cjs/utils.js.map +0 -1
  371. package/cjs/writeToReporters.d.ts +0 -6
  372. package/cjs/writeToReporters.d.ts.map +0 -1
  373. package/cjs/writeToReporters.js +0 -22
  374. package/cjs/writeToReporters.js.map +0 -1
  375. package/cjs/writeToReporters.spec.d.ts +0 -2
  376. package/cjs/writeToReporters.spec.d.ts.map +0 -1
  377. package/cjs/writeToReporters.spec.js +0 -59
  378. package/cjs/writeToReporters.spec.js.map +0 -1
  379. package/esm/LogEntry.d.ts +0 -7
  380. package/esm/LogEntry.d.ts.map +0 -1
  381. package/esm/LogEntry.js +0 -2
  382. package/esm/LogEntry.js.map +0 -1
  383. package/esm/captureLogs.d.ts +0 -4
  384. package/esm/captureLogs.d.ts.map +0 -1
  385. package/esm/captureLogs.js +0 -29
  386. package/esm/captureLogs.js.map +0 -1
  387. package/esm/captureLogs.spec.d.ts +0 -2
  388. package/esm/captureLogs.spec.d.ts.map +0 -1
  389. package/esm/captureLogs.spec.js +0 -45
  390. package/esm/captureLogs.spec.js.map +0 -1
  391. package/esm/config.d.ts +0 -12
  392. package/esm/config.d.ts.map +0 -1
  393. package/esm/config.js +0 -44
  394. package/esm/config.js.map +0 -1
  395. package/esm/config.spec.d.ts +0 -2
  396. package/esm/config.spec.d.ts.map +0 -1
  397. package/esm/config.spec.js +0 -67
  398. package/esm/config.spec.js.map +0 -1
  399. package/esm/configForTest.d.ts +0 -5
  400. package/esm/configForTest.d.ts.map +0 -1
  401. package/esm/configForTest.js +0 -14
  402. package/esm/configForTest.js.map +0 -1
  403. package/esm/configForTest.spec.d.ts +0 -2
  404. package/esm/configForTest.spec.d.ts.map +0 -1
  405. package/esm/configForTest.spec.js +0 -15
  406. package/esm/configForTest.spec.js.map +0 -1
  407. package/esm/console/createConsoleLogReporter.d.ts.map +0 -1
  408. package/esm/console/createConsoleLogReporter.js +0 -37
  409. package/esm/console/createConsoleLogReporter.js.map +0 -1
  410. package/esm/console/createConsoleLogReporter.spec.d.ts +0 -2
  411. package/esm/console/createConsoleLogReporter.spec.d.ts.map +0 -1
  412. package/esm/console/createConsoleLogReporter.spec.js.map +0 -1
  413. package/esm/console/index.d.ts +0 -4
  414. package/esm/console/index.d.ts.map +0 -1
  415. package/esm/console/index.js +0 -4
  416. package/esm/console/index.js.map +0 -1
  417. package/esm/console/isConsoleDebugAvailable.d.ts +0 -2
  418. package/esm/console/isConsoleDebugAvailable.d.ts.map +0 -1
  419. package/esm/console/isConsoleDebugAvailable.js +0 -13
  420. package/esm/console/isConsoleDebugAvailable.js.map +0 -1
  421. package/esm/console/polyfilledConsole.d.ts +0 -7
  422. package/esm/console/polyfilledConsole.d.ts.map +0 -1
  423. package/esm/console/polyfilledConsole.js.map +0 -1
  424. package/esm/console/semverGt.d.ts +0 -2
  425. package/esm/console/semverGt.d.ts.map +0 -1
  426. package/esm/console/semverGt.js +0 -9
  427. package/esm/console/semverGt.js.map +0 -1
  428. package/esm/console/semverGt.spec.d.ts +0 -2
  429. package/esm/console/semverGt.spec.d.ts.map +0 -1
  430. package/esm/console/semverGt.spec.js.map +0 -1
  431. package/esm/console/toConsoleMethod.d.ts +0 -2
  432. package/esm/console/toConsoleMethod.d.ts.map +0 -1
  433. package/esm/console/toConsoleMethod.js +0 -18
  434. package/esm/console/toConsoleMethod.js.map +0 -1
  435. package/esm/console/types.d.ts +0 -3
  436. package/esm/console/types.d.ts.map +0 -1
  437. package/esm/console/types.js +0 -2
  438. package/esm/console/types.js.map +0 -1
  439. package/esm/customLogLevel.d.ts +0 -11
  440. package/esm/customLogLevel.d.ts.map +0 -1
  441. package/esm/customLogLevel.js +0 -30
  442. package/esm/customLogLevel.js.map +0 -1
  443. package/esm/customLogLevel.spec.d.ts +0 -2
  444. package/esm/customLogLevel.spec.d.ts.map +0 -1
  445. package/esm/customLogLevel.spec.js +0 -32
  446. package/esm/customLogLevel.spec.js.map +0 -1
  447. package/esm/formatter/createTimestampFormatter.d.ts +0 -3
  448. package/esm/formatter/createTimestampFormatter.d.ts.map +0 -1
  449. package/esm/formatter/createTimestampFormatter.js.map +0 -1
  450. package/esm/formatter/createTimestampFormatter.spec.d.ts +0 -2
  451. package/esm/formatter/createTimestampFormatter.spec.d.ts.map +0 -1
  452. package/esm/formatter/createTimestampFormatter.spec.js +0 -21
  453. package/esm/formatter/createTimestampFormatter.spec.js.map +0 -1
  454. package/esm/formatter/formatLogLevel.d.ts +0 -2
  455. package/esm/formatter/formatLogLevel.d.ts.map +0 -1
  456. package/esm/formatter/formatLogLevel.js +0 -6
  457. package/esm/formatter/formatLogLevel.js.map +0 -1
  458. package/esm/formatter/index.d.ts +0 -4
  459. package/esm/formatter/index.d.ts.map +0 -1
  460. package/esm/formatter/index.js +0 -4
  461. package/esm/formatter/index.js.map +0 -1
  462. package/esm/formatter/plainLogFormatter.d.ts +0 -3
  463. package/esm/formatter/plainLogFormatter.d.ts.map +0 -1
  464. package/esm/formatter/plainLogFormatter.js +0 -5
  465. package/esm/formatter/plainLogFormatter.js.map +0 -1
  466. package/esm/formatter/plainLogFormatter.spec.d.ts +0 -2
  467. package/esm/formatter/plainLogFormatter.spec.d.ts.map +0 -1
  468. package/esm/formatter/plainLogFormatter.spec.js +0 -7
  469. package/esm/formatter/plainLogFormatter.spec.js.map +0 -1
  470. package/esm/getDefaultReporter.browser.d.ts +0 -2
  471. package/esm/getDefaultReporter.browser.d.ts.map +0 -1
  472. package/esm/getDefaultReporter.browser.js +0 -11
  473. package/esm/getDefaultReporter.browser.js.map +0 -1
  474. package/esm/getDefaultReporter.d.ts +0 -2
  475. package/esm/getDefaultReporter.d.ts.map +0 -1
  476. package/esm/getDefaultReporter.js +0 -15
  477. package/esm/getDefaultReporter.js.map +0 -1
  478. package/esm/getLogModeFromEnvironment.browser.d.ts +0 -3
  479. package/esm/getLogModeFromEnvironment.browser.d.ts.map +0 -1
  480. package/esm/getLogModeFromEnvironment.browser.js +0 -5
  481. package/esm/getLogModeFromEnvironment.browser.js.map +0 -1
  482. package/esm/getLogModeFromEnvironment.d.ts +0 -3
  483. package/esm/getLogModeFromEnvironment.d.ts.map +0 -1
  484. package/esm/getLogModeFromEnvironment.js +0 -13
  485. package/esm/getLogModeFromEnvironment.js.map +0 -1
  486. package/esm/getLogModeFromEnvironment.spec.d.ts +0 -2
  487. package/esm/getLogModeFromEnvironment.spec.d.ts.map +0 -1
  488. package/esm/getLogModeFromEnvironment.spec.js +0 -20
  489. package/esm/getLogModeFromEnvironment.spec.js.map +0 -1
  490. package/esm/getLogger.d.ts +0 -9
  491. package/esm/getLogger.d.ts.map +0 -1
  492. package/esm/getLogger.js +0 -78
  493. package/esm/getLogger.js.map +0 -1
  494. package/esm/getLogger.spec.d.ts +0 -2
  495. package/esm/getLogger.spec.d.ts.map +0 -1
  496. package/esm/getLogger.spec.js +0 -385
  497. package/esm/getLogger.spec.js.map +0 -1
  498. package/esm/getLoggers.d.ts +0 -7
  499. package/esm/getLoggers.d.ts.map +0 -1
  500. package/esm/getLoggers.js +0 -11
  501. package/esm/getLoggers.js.map +0 -1
  502. package/esm/logLevel.d.ts +0 -106
  503. package/esm/logLevel.d.ts.map +0 -1
  504. package/esm/logLevel.js.map +0 -1
  505. package/esm/logLevel.spec.d.ts +0 -2
  506. package/esm/logLevel.spec.d.ts.map +0 -1
  507. package/esm/logLevel.spec.js +0 -148
  508. package/esm/logLevel.spec.js.map +0 -1
  509. package/esm/logLevelFn.d.ts +0 -20
  510. package/esm/logLevelFn.d.ts.map +0 -1
  511. package/esm/logLevelFn.js +0 -67
  512. package/esm/logLevelFn.js.map +0 -1
  513. package/esm/logReporter.d.ts +0 -7
  514. package/esm/logReporter.d.ts.map +0 -1
  515. package/esm/logReporter.js +0 -21
  516. package/esm/logReporter.js.map +0 -1
  517. package/esm/logReporter.spec.d.ts +0 -2
  518. package/esm/logReporter.spec.d.ts.map +0 -1
  519. package/esm/logReporter.spec.js +0 -93
  520. package/esm/logReporter.spec.js.map +0 -1
  521. package/esm/logReporterInternal.d.ts +0 -3
  522. package/esm/logReporterInternal.d.ts.map +0 -1
  523. package/esm/logReporterInternal.js +0 -19
  524. package/esm/logReporterInternal.js.map +0 -1
  525. package/esm/memory/MemoryLogReporter.d.ts.map +0 -1
  526. package/esm/memory/MemoryLogReporter.js +0 -51
  527. package/esm/memory/MemoryLogReporter.js.map +0 -1
  528. package/esm/memory/MemoryLogReporter.spec.d.ts +0 -2
  529. package/esm/memory/MemoryLogReporter.spec.d.ts.map +0 -1
  530. package/esm/memory/MemoryLogReporter.spec.js +0 -111
  531. package/esm/memory/MemoryLogReporter.spec.js.map +0 -1
  532. package/esm/memory/index.d.ts +0 -3
  533. package/esm/memory/index.d.ts.map +0 -1
  534. package/esm/memory/index.js +0 -3
  535. package/esm/memory/index.js.map +0 -1
  536. package/esm/memory/logEntriesToString.d.ts +0 -3
  537. package/esm/memory/logEntriesToString.d.ts.map +0 -1
  538. package/esm/memory/logEntriesToString.js +0 -6
  539. package/esm/memory/logEntriesToString.js.map +0 -1
  540. package/esm/memory/logEntriesToString.spec.d.ts +0 -2
  541. package/esm/memory/logEntriesToString.spec.d.ts.map +0 -1
  542. package/esm/memory/logEntriesToString.spec.js +0 -42
  543. package/esm/memory/logEntriesToString.spec.js.map +0 -1
  544. package/esm/memory/toInspectStringForObject.d.ts +0 -3
  545. package/esm/memory/toInspectStringForObject.d.ts.map +0 -1
  546. package/esm/memory/toInspectStringForObject.js +0 -11
  547. package/esm/memory/toInspectStringForObject.js.map +0 -1
  548. package/esm/shouldLog.d.ts +0 -8
  549. package/esm/shouldLog.d.ts.map +0 -1
  550. package/esm/shouldLog.js +0 -10
  551. package/esm/shouldLog.js.map +0 -1
  552. package/esm/store.d.ts +0 -3
  553. package/esm/store.d.ts.map +0 -1
  554. package/esm/store.js +0 -24
  555. package/esm/store.js.map +0 -1
  556. package/esm/suppressLogs.d.ts +0 -6
  557. package/esm/suppressLogs.d.ts.map +0 -1
  558. package/esm/suppressLogs.js +0 -9
  559. package/esm/suppressLogs.js.map +0 -1
  560. package/esm/suppressLogs.spec.d.ts +0 -2
  561. package/esm/suppressLogs.spec.d.ts.map +0 -1
  562. package/esm/suppressLogs.spec.js +0 -29
  563. package/esm/suppressLogs.spec.js.map +0 -1
  564. package/esm/typesInternal.d.ts +0 -20
  565. package/esm/typesInternal.d.ts.map +0 -1
  566. package/esm/typesInternal.js +0 -2
  567. package/esm/typesInternal.js.map +0 -1
  568. package/esm/utils.d.ts +0 -6
  569. package/esm/utils.d.ts.map +0 -1
  570. package/esm/utils.js +0 -11
  571. package/esm/utils.js.map +0 -1
  572. package/esm/writeToReporters.d.ts +0 -6
  573. package/esm/writeToReporters.d.ts.map +0 -1
  574. package/esm/writeToReporters.js +0 -18
  575. package/esm/writeToReporters.js.map +0 -1
  576. package/esm/writeToReporters.spec.d.ts +0 -2
  577. package/esm/writeToReporters.spec.d.ts.map +0 -1
  578. package/esm/writeToReporters.spec.js +0 -9
  579. package/esm/writeToReporters.spec.js.map +0 -1
  580. package/ts/LogEntry.ts +0 -7
  581. package/ts/captureLogs.ts +0 -35
  582. package/ts/config.ts +0 -57
  583. package/ts/configForTest.ts +0 -16
  584. package/ts/console/createConsoleLogReporter.ts +0 -48
  585. package/ts/console/index.ts +0 -3
  586. package/ts/console/isConsoleDebugAvailable.ts +0 -11
  587. package/ts/console/polyfilledConsole.ts +0 -34
  588. package/ts/console/semverGt.ts +0 -9
  589. package/ts/console/toConsoleMethod.ts +0 -18
  590. package/ts/console/types.ts +0 -3
  591. package/ts/customLogLevel.ts +0 -35
  592. package/ts/formatter/formatLogLevel.ts +0 -6
  593. package/ts/formatter/index.ts +0 -3
  594. package/ts/formatter/plainLogFormatter.ts +0 -6
  595. package/ts/getDefaultReporter.browser.ts +0 -13
  596. package/ts/getDefaultReporter.ts +0 -15
  597. package/ts/getLogModeFromEnvironment.browser.ts +0 -6
  598. package/ts/getLogModeFromEnvironment.ts +0 -16
  599. package/ts/getLogger.ts +0 -92
  600. package/ts/getLoggers.ts +0 -12
  601. package/ts/logLevelFn.ts +0 -72
  602. package/ts/logReporter.ts +0 -26
  603. package/ts/logReporterInternal.ts +0 -18
  604. package/ts/memory/MemoryLogReporter.ts +0 -72
  605. package/ts/memory/index.ts +0 -2
  606. package/ts/memory/logEntriesToString.ts +0 -7
  607. package/ts/memory/toInspectStringForObject.ts +0 -13
  608. package/ts/shouldLog.ts +0 -11
  609. package/ts/store.ts +0 -25
  610. package/ts/suppressLogs.ts +0 -14
  611. package/ts/typesInternal.ts +0 -21
  612. package/ts/utils.ts +0 -11
  613. package/ts/writeToReporters.ts +0 -20
@@ -0,0 +1,536 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ var assertron_1 = require("assertron");
40
+ var errors_js_1 = require("./errors.js");
41
+ var logLevels_js_1 = require("./logLevels.js");
42
+ var memory_js_1 = require("./memory.js");
43
+ var standardLog_js_1 = require("./standardLog.js");
44
+ var testUtil_js_1 = require("./testUtil.js");
45
+ describe('createStandardLog()', function () {
46
+ describe('logLevel', function () {
47
+ it('is default to info', function () {
48
+ var actual = (0, standardLog_js_1.createStandardLog)();
49
+ expect(actual.logLevel).toBe(logLevels_js_1.logLevels.info);
50
+ });
51
+ it('is readonly', function () {
52
+ var actual = (0, standardLog_js_1.createStandardLog)();
53
+ assertron_1.assertron.throws(function () { return actual.logLevel = logLevels_js_1.logLevels.planck; }, function (err) { return /only a getter/.test(err); });
54
+ });
55
+ it('set logLevel from options', function () {
56
+ var actual = (0, standardLog_js_1.createStandardLog)({ logLevel: logLevels_js_1.logLevels.planck });
57
+ expect(actual.logLevel).toBe(logLevels_js_1.logLevels.planck);
58
+ });
59
+ });
60
+ describe('custom levels', function () {
61
+ it('can define custom levels', function () {
62
+ var actual = (0, standardLog_js_1.createStandardLog)({ customLevels: { urgent: 80 } });
63
+ expect(actual.toLogLevelName(80)).toBe('urgent');
64
+ });
65
+ });
66
+ describe('reporters', function () {
67
+ it('can specify reporter', function () {
68
+ var mem = (0, memory_js_1.createMemoryLogReporter)();
69
+ var sl = (0, standardLog_js_1.createStandardLog)({ reporters: [mem] });
70
+ var log = sl.getLogger(['x']);
71
+ log.info('abc');
72
+ expect(mem.logs.length).toBe(1);
73
+ });
74
+ });
75
+ });
76
+ describe('createStandardLogForTest()', function () {
77
+ it('returns with memory reporter', function () {
78
+ var reporter = (0, standardLog_js_1.createStandardLogForTest)().reporter;
79
+ expect(reporter.getLogMessageWithLevel()).toBe('');
80
+ });
81
+ it('defaults to debug', function () {
82
+ var store = (0, standardLog_js_1.createStandardLogForTest)();
83
+ expect(store.logLevel).toBe(logLevels_js_1.logLevels.debug);
84
+ });
85
+ });
86
+ describe('getLogger()', function () {
87
+ it('supports id with alphanumeric and :_-.', function () {
88
+ var sl = (0, standardLog_js_1.createStandardLog)();
89
+ sl.getLogger(['abcdefghijklmnopqrstuvwxyz:-_.1234567890']);
90
+ });
91
+ it('supports id with unicode', function () {
92
+ var sl = (0, standardLog_js_1.createStandardLog)();
93
+ sl.getLogger(['ミク香港']);
94
+ });
95
+ it('supports id with @, \\ and /', function () {
96
+ var sl = (0, standardLog_js_1.createStandardLog)();
97
+ sl.getLogger(['@unional/fixture']);
98
+ sl.getLogger(["a\\b\\c"]);
99
+ });
100
+ it.each('`~!#$%^&*()=+|[]{}<>,?'.split(''))('throws if id has unsupported character %s', function (char) {
101
+ var sl = (0, standardLog_js_1.createStandardLog)();
102
+ assertron_1.assertron.throws(function () { return sl.getLogger([char]); }, errors_js_1.InvalidId);
103
+ });
104
+ it('throw InvalidId with ssf to the call site', function () {
105
+ var sl = (0, standardLog_js_1.createStandardLog)();
106
+ var err = assertron_1.assertron.throws(function () { return sl.getLogger(['!']); }, errors_js_1.InvalidId);
107
+ (0, testUtil_js_1.assertSSF)(err, __filename);
108
+ });
109
+ test('id is readonly', function () {
110
+ var sl = (0, standardLog_js_1.createStandardLog)();
111
+ var log = sl.getLogger(['id is readonly']);
112
+ assertron_1.assertron.throws(function () { return log.id = 'b'; });
113
+ });
114
+ test('get logger with same name gets the same instance', function () {
115
+ var sl = (0, standardLog_js_1.createStandardLog)();
116
+ var expected = sl.getLogger(['same-inst']);
117
+ var actual = sl.getLogger(['same-inst']);
118
+ expect(actual).toBe(expected);
119
+ });
120
+ it('can specify local log level', function () {
121
+ var sl = (0, standardLog_js_1.createStandardLog)();
122
+ var log = sl.getLogger(['local', { level: logLevels_js_1.logLevels.trace }]);
123
+ expect(log.level).toBe(logLevels_js_1.logLevels.trace);
124
+ });
125
+ test('new logger will get custom level', function () {
126
+ var sl = (0, standardLog_js_1.createStandardLog)({ customLevels: { 'to_logger': 1234 } });
127
+ var actual = sl.getLogger(['to_logger_logger']);
128
+ expect(typeof actual.to_logger).toBe('function');
129
+ });
130
+ describe('log levels', function () {
131
+ function assertLoggedAtLevel(sl, method, level) {
132
+ return __awaiter(this, void 0, void 0, function () {
133
+ var log, msg;
134
+ return __generator(this, function (_a) {
135
+ log = sl.getLogger([method]);
136
+ msg = "should log on level: ".concat(level);
137
+ log[method](msg);
138
+ assertron_1.assertron.satisfies(sl.reporter.logs, [{ id: method, level: sl.toLogLevel(method), args: [msg] }]);
139
+ return [2 /*return*/];
140
+ });
141
+ });
142
+ }
143
+ function assertNotLoggedAtLevel(sl, method, level) {
144
+ return __awaiter(this, void 0, void 0, function () {
145
+ var log;
146
+ return __generator(this, function (_a) {
147
+ log = sl.getLogger([method]);
148
+ log[method]("should not log on level: ".concat(level));
149
+ expect(sl.reporter.logs.length).toBe(0);
150
+ return [2 /*return*/];
151
+ });
152
+ });
153
+ }
154
+ function assertLoggedAtLocalLevel(sl, method, localLevel) {
155
+ return __awaiter(this, void 0, void 0, function () {
156
+ var log, msg;
157
+ return __generator(this, function (_a) {
158
+ log = sl.getLogger([method, { level: localLevel }]);
159
+ msg = "should log on level: ".concat(localLevel);
160
+ log[method](msg);
161
+ assertron_1.assertron.satisfies(sl.reporter.logs, [{ id: log.id, level: sl.toLogLevel(method), args: [msg] }]);
162
+ return [2 /*return*/];
163
+ });
164
+ });
165
+ }
166
+ function assertNotLoggedAtLocalLevel(sl, method, localLevel) {
167
+ return __awaiter(this, void 0, void 0, function () {
168
+ var log;
169
+ return __generator(this, function (_a) {
170
+ log = sl.getLogger([method, { level: localLevel }]);
171
+ log[method]("should not log on level: ".concat(localLevel));
172
+ expect(sl.reporter.logs.length).toBe(0);
173
+ return [2 /*return*/];
174
+ });
175
+ });
176
+ }
177
+ function assertLoggedAtCallLevel(sl, method, callLevel) {
178
+ return __awaiter(this, void 0, void 0, function () {
179
+ var log, actual;
180
+ return __generator(this, function (_a) {
181
+ log = sl.getLogger([method]);
182
+ actual = false;
183
+ log.on(callLevel, function () { return actual = true; });
184
+ expect(actual).toBe(true);
185
+ return [2 /*return*/];
186
+ });
187
+ });
188
+ }
189
+ function assertNotLoggedAtCallLevel(sl, method, callLevel, actualLevel) {
190
+ return __awaiter(this, void 0, void 0, function () {
191
+ var log;
192
+ return __generator(this, function (_a) {
193
+ log = sl.getLogger([method]);
194
+ log.on(callLevel, function () { throw new Error("should not log at level ".concat(actualLevel)); });
195
+ return [2 /*return*/];
196
+ });
197
+ });
198
+ }
199
+ function assertLoggedAtCallLevelOverrideLocalLevel(sl, method, localLevel, callLevel) {
200
+ return __awaiter(this, void 0, void 0, function () {
201
+ var log, actual;
202
+ return __generator(this, function (_a) {
203
+ log = sl.getLogger([method, { level: localLevel }]);
204
+ actual = false;
205
+ log.on(callLevel, function () { return actual = true; });
206
+ expect(actual).toBe(true);
207
+ return [2 /*return*/];
208
+ });
209
+ });
210
+ }
211
+ function assertNotLoggedAtCallLevelOverrideLocalLevel(sl, method, localLevel, callLevel) {
212
+ return __awaiter(this, void 0, void 0, function () {
213
+ var log;
214
+ return __generator(this, function (_a) {
215
+ log = sl.getLogger([method, { level: localLevel }]);
216
+ log.on(callLevel, function () { throw new Error("should not log at level ".concat(localLevel)); });
217
+ return [2 /*return*/];
218
+ });
219
+ });
220
+ }
221
+ var shouldLog = (0, testUtil_js_1.wrapTest)(function (test) { return function (method, level) {
222
+ var sl = (0, standardLog_js_1.createStandardLogForTest)(level);
223
+ var name = sl.toLogLevelName(level);
224
+ test("".concat(method, "() should log on level: ").concat(name, " (").concat(level, ")"), function () {
225
+ return assertLoggedAtLevel(sl, method, level);
226
+ });
227
+ }; });
228
+ var shouldNotLog = (0, testUtil_js_1.wrapTest)(function (test) { return function (method, level) {
229
+ var sl = (0, standardLog_js_1.createStandardLogForTest)(level);
230
+ var name = sl.toLogLevelName(level);
231
+ test("".concat(method, "() should not log on level: ").concat(name, " (").concat(level, ")"), function () {
232
+ return assertNotLoggedAtLevel(sl, method, level);
233
+ });
234
+ }; });
235
+ var shouldLogWithLocalLevelOverride = (0, testUtil_js_1.wrapTest)(function (test) { return function (method, localLevel) {
236
+ var localName = (0, logLevels_js_1.toLogLevelName)(localLevel);
237
+ [logLevels_js_1.logLevels.none, logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.debug].forEach(function (globalLevel) {
238
+ var globalName = (0, logLevels_js_1.toLogLevelName)(globalLevel) || 'none';
239
+ test("".concat(method, "() should log on local level: ").concat(localName, " (").concat(localLevel, ") while global level: ").concat(globalName, " (").concat(globalLevel, ")"), function () {
240
+ var sl = (0, standardLog_js_1.createStandardLogForTest)(globalLevel);
241
+ return assertLoggedAtLocalLevel(sl, method, localLevel);
242
+ });
243
+ });
244
+ }; });
245
+ var shouldNotLogWithLocalLevelOverride = (0, testUtil_js_1.wrapTest)(function (test) { return function (method, localLevel) {
246
+ var localName = (0, logLevels_js_1.toLogLevelName)(localLevel);
247
+ [logLevels_js_1.logLevels.none, logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.debug].forEach(function (globalLevel) {
248
+ var globalName = (0, logLevels_js_1.toLogLevelName)(globalLevel) || 'none';
249
+ test("".concat(method, "() should not log on local level: ").concat(localName, " (").concat(localLevel, ") while global level: ").concat(globalName, " (").concat(globalLevel, ")"), function () {
250
+ var sl = (0, standardLog_js_1.createStandardLogForTest)(globalLevel);
251
+ return assertNotLoggedAtLocalLevel(sl, method, localLevel);
252
+ });
253
+ });
254
+ }; });
255
+ var shouldCallLogFunction = (0, testUtil_js_1.wrapTest)(function (test) { return function (callLevel, actualLevel) {
256
+ var method = (0, logLevels_js_1.toLogLevelName)(callLevel);
257
+ var name = (0, logLevels_js_1.toLogLevelName)(actualLevel);
258
+ test("".concat(method, "() should call log function on level: ").concat(name, " (").concat(actualLevel, ")"), function () {
259
+ var sl = (0, standardLog_js_1.createStandardLogForTest)(actualLevel);
260
+ return assertLoggedAtCallLevel(sl, method, callLevel);
261
+ });
262
+ }; });
263
+ var shouldNotCallLogFunction = (0, testUtil_js_1.wrapTest)(function (test) { return function (callLevel, actualLevel) {
264
+ var method = (0, logLevels_js_1.toLogLevelName)(callLevel);
265
+ var name = (0, logLevels_js_1.toLogLevelName)(actualLevel);
266
+ test("".concat(method, "() should not call log function on level: ").concat(name, " (").concat(actualLevel, ")"), function () {
267
+ var sl = (0, standardLog_js_1.createStandardLogForTest)(actualLevel);
268
+ return assertNotLoggedAtCallLevel(sl, method, callLevel, actualLevel);
269
+ });
270
+ }; });
271
+ var shouldCallLogFunctionWithLocalLevelOverride = (0, testUtil_js_1.wrapTest)(function (test) { return function (callLevel, localLevel) {
272
+ var method = (0, logLevels_js_1.toLogLevelName)(callLevel);
273
+ var localName = (0, logLevels_js_1.toLogLevelName)(localLevel);
274
+ [logLevels_js_1.logLevels.none, logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.debug].forEach(function (globalLevel) {
275
+ var globalName = (0, logLevels_js_1.toLogLevelName)(globalLevel) || 'none';
276
+ test("".concat(method, "() should log on local level: ").concat(localName, " (").concat(localLevel, ") while global level: ").concat(globalName, " (").concat(globalLevel, ")"), function () {
277
+ var sl = (0, standardLog_js_1.createStandardLogForTest)(globalLevel);
278
+ return assertLoggedAtCallLevelOverrideLocalLevel(sl, method, localLevel, callLevel);
279
+ });
280
+ });
281
+ }; });
282
+ var shouldNotCallLogFunctionWithLocalLevelOverride = (0, testUtil_js_1.wrapTest)(function (test) { return function (callLevel, localLevel) {
283
+ var method = (0, logLevels_js_1.toLogLevelName)(callLevel);
284
+ var localName = (0, logLevels_js_1.toLogLevelName)(localLevel);
285
+ [logLevels_js_1.logLevels.none, logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.debug].forEach(function (globalLevel) {
286
+ var globalName = (0, logLevels_js_1.toLogLevelName)(globalLevel) || 'none';
287
+ test("".concat(method, "() should not log on local level: ").concat(localName, " (").concat(localLevel, ") while global level: ").concat(globalName, " (").concat(globalLevel, ")"), function () {
288
+ var sl = (0, standardLog_js_1.createStandardLogForTest)(globalLevel);
289
+ return assertNotLoggedAtCallLevelOverrideLocalLevel(sl, method, localLevel, callLevel);
290
+ });
291
+ });
292
+ }; });
293
+ shouldNotLog('error', logLevels_js_1.logLevels.none);
294
+ shouldLog('error', logLevels_js_1.logLevels.error);
295
+ shouldLog('error', logLevels_js_1.logLevels.warn);
296
+ shouldLog('error', logLevels_js_1.logLevels.info);
297
+ shouldLog('error', logLevels_js_1.logLevels.debug);
298
+ shouldNotLogWithLocalLevelOverride('error', logLevels_js_1.logLevels.none);
299
+ shouldLogWithLocalLevelOverride('error', logLevels_js_1.logLevels.error);
300
+ shouldLogWithLocalLevelOverride('error', logLevels_js_1.logLevels.warn);
301
+ shouldLogWithLocalLevelOverride('error', logLevels_js_1.logLevels.info);
302
+ shouldLogWithLocalLevelOverride('error', logLevels_js_1.logLevels.debug);
303
+ shouldNotLog('warn', logLevels_js_1.logLevels.none);
304
+ shouldNotLog('warn', logLevels_js_1.logLevels.error);
305
+ shouldLog('warn', logLevels_js_1.logLevels.warn);
306
+ shouldLog('warn', logLevels_js_1.logLevels.info);
307
+ shouldLog('warn', logLevels_js_1.logLevels.debug);
308
+ shouldNotLogWithLocalLevelOverride('warn', logLevels_js_1.logLevels.none);
309
+ shouldNotLogWithLocalLevelOverride('warn', logLevels_js_1.logLevels.error);
310
+ shouldLogWithLocalLevelOverride('warn', logLevels_js_1.logLevels.warn);
311
+ shouldLogWithLocalLevelOverride('warn', logLevels_js_1.logLevels.info);
312
+ shouldLogWithLocalLevelOverride('warn', logLevels_js_1.logLevels.debug);
313
+ shouldNotLog('info', logLevels_js_1.logLevels.none);
314
+ shouldNotLog('info', logLevels_js_1.logLevels.error);
315
+ shouldNotLog('info', logLevels_js_1.logLevels.warn);
316
+ shouldLog('info', logLevels_js_1.logLevels.info);
317
+ shouldLog('info', logLevels_js_1.logLevels.debug);
318
+ shouldNotLogWithLocalLevelOverride('info', logLevels_js_1.logLevels.none);
319
+ shouldNotLogWithLocalLevelOverride('info', logLevels_js_1.logLevels.error);
320
+ shouldNotLogWithLocalLevelOverride('info', logLevels_js_1.logLevels.warn);
321
+ shouldLogWithLocalLevelOverride('info', logLevels_js_1.logLevels.info);
322
+ shouldLogWithLocalLevelOverride('info', logLevels_js_1.logLevels.debug);
323
+ shouldNotLog('debug', logLevels_js_1.logLevels.none);
324
+ shouldNotLog('debug', logLevels_js_1.logLevels.error);
325
+ shouldNotLog('debug', logLevels_js_1.logLevels.warn);
326
+ shouldNotLog('debug', logLevels_js_1.logLevels.info);
327
+ shouldLog('debug', logLevels_js_1.logLevels.debug);
328
+ shouldNotLogWithLocalLevelOverride('debug', logLevels_js_1.logLevels.none);
329
+ shouldNotLogWithLocalLevelOverride('debug', logLevels_js_1.logLevels.error);
330
+ shouldNotLogWithLocalLevelOverride('debug', logLevels_js_1.logLevels.warn);
331
+ shouldNotLogWithLocalLevelOverride('debug', logLevels_js_1.logLevels.info);
332
+ shouldLogWithLocalLevelOverride('debug', logLevels_js_1.logLevels.debug);
333
+ shouldNotCallLogFunction(logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.none);
334
+ shouldCallLogFunction(logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.error);
335
+ shouldCallLogFunction(logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.warn);
336
+ shouldCallLogFunction(logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.info);
337
+ shouldCallLogFunction(logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.debug);
338
+ shouldNotCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.none);
339
+ shouldCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.error);
340
+ shouldCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.warn);
341
+ shouldCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.info);
342
+ shouldCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.error, logLevels_js_1.logLevels.debug);
343
+ shouldNotCallLogFunction(logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.none);
344
+ shouldNotCallLogFunction(logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.error);
345
+ shouldCallLogFunction(logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.warn);
346
+ shouldCallLogFunction(logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.info);
347
+ shouldCallLogFunction(logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.debug);
348
+ shouldNotCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.none);
349
+ shouldNotCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.error);
350
+ shouldCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.warn);
351
+ shouldCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.info);
352
+ shouldCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.warn, logLevels_js_1.logLevels.debug);
353
+ shouldNotCallLogFunction(logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.none);
354
+ shouldNotCallLogFunction(logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.error);
355
+ shouldNotCallLogFunction(logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.warn);
356
+ shouldCallLogFunction(logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.info);
357
+ shouldCallLogFunction(logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.debug);
358
+ shouldNotCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.none);
359
+ shouldNotCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.error);
360
+ shouldNotCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.warn);
361
+ shouldCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.info);
362
+ shouldCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.info, logLevels_js_1.logLevels.debug);
363
+ shouldNotCallLogFunction(logLevels_js_1.logLevels.debug, logLevels_js_1.logLevels.none);
364
+ shouldNotCallLogFunction(logLevels_js_1.logLevels.debug, logLevels_js_1.logLevels.error);
365
+ shouldNotCallLogFunction(logLevels_js_1.logLevels.debug, logLevels_js_1.logLevels.warn);
366
+ shouldNotCallLogFunction(logLevels_js_1.logLevels.debug, logLevels_js_1.logLevels.info);
367
+ shouldCallLogFunction(logLevels_js_1.logLevels.debug, logLevels_js_1.logLevels.debug);
368
+ shouldNotCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.debug, logLevels_js_1.logLevels.none);
369
+ shouldNotCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.debug, logLevels_js_1.logLevels.error);
370
+ shouldNotCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.debug, logLevels_js_1.logLevels.warn);
371
+ shouldNotCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.debug, logLevels_js_1.logLevels.info);
372
+ shouldCallLogFunctionWithLocalLevelOverride(logLevels_js_1.logLevels.debug, logLevels_js_1.logLevels.debug);
373
+ });
374
+ it('writes entry directly', function () {
375
+ var sl = (0, standardLog_js_1.createStandardLogForTest)();
376
+ var log = sl.getLogger(['write-entry']);
377
+ var entry = { id: 'write-entry', level: logLevels_js_1.logLevels.info, args: ['abc'], timestamp: new Date() };
378
+ log.write(entry);
379
+ assertron_1.assertron.satisfies(sl.reporter.logs, [entry]);
380
+ });
381
+ test.each(['on', 'count', 'error', 'warn', 'info', 'debug'])('method %s is readonly', function (name) {
382
+ var sl = (0, standardLog_js_1.createStandardLog)();
383
+ var log = sl.getLogger(["".concat(name, " is readonly")]);
384
+ assertron_1.assertron.throws(function () { return log[name] = true; });
385
+ });
386
+ describe('on()', function () {
387
+ it('log using log argument', function () {
388
+ var sl = (0, standardLog_js_1.createStandardLogForTest)();
389
+ var logger = sl.getLogger(['log on fn']);
390
+ logger.on('error', function (log) { log('value'); });
391
+ assertron_1.assertron.satisfies(sl.reporter.logs, [
392
+ { id: 'log on fn', level: logLevels_js_1.logLevels.error, args: ['value'] }
393
+ ]);
394
+ });
395
+ it('can take log level name in first argument', function () {
396
+ var sl = (0, standardLog_js_1.createStandardLogForTest)();
397
+ var log = sl.getLogger(['string-on']);
398
+ log.on('debug', function () { return; });
399
+ });
400
+ });
401
+ describe('count()', function () {
402
+ test('will increment the counter', function () { return __awaiter(void 0, void 0, void 0, function () {
403
+ var sl, logger;
404
+ return __generator(this, function (_a) {
405
+ sl = (0, standardLog_js_1.createStandardLogForTest)();
406
+ logger = sl.getLogger(['inc counter']);
407
+ logger.count();
408
+ logger.count();
409
+ assertron_1.assertron.satisfies(sl.reporter.logs, [
410
+ { id: 'inc counter', level: logLevels_js_1.logLevels.debug, args: [1] },
411
+ { id: 'inc counter', level: logLevels_js_1.logLevels.debug, args: [2] }
412
+ ]);
413
+ return [2 /*return*/];
414
+ });
415
+ }); });
416
+ test('append args after the counter', function () { return __awaiter(void 0, void 0, void 0, function () {
417
+ var sl, id, logger;
418
+ return __generator(this, function (_a) {
419
+ sl = (0, standardLog_js_1.createStandardLogForTest)(logLevels_js_1.logLevels.debug);
420
+ id = 'inc with args';
421
+ logger = sl.getLogger([id]);
422
+ logger.count('msg1', 'msg2');
423
+ assertron_1.assertron.satisfies(sl.reporter.logs, [
424
+ { id: id, level: logLevels_js_1.logLevels.debug, args: [1, 'msg1', 'msg2'] }
425
+ ]);
426
+ return [2 /*return*/];
427
+ });
428
+ }); });
429
+ test('not log if log level is less than debug', function () { return __awaiter(void 0, void 0, void 0, function () {
430
+ var sl, id, logger;
431
+ return __generator(this, function (_a) {
432
+ sl = (0, standardLog_js_1.createStandardLogForTest)(logLevels_js_1.logLevels.debug - 1);
433
+ id = 'inc with args';
434
+ logger = sl.getLogger([id]);
435
+ logger.count('msg1', 'msg2');
436
+ expect(sl.reporter.logs.length).toBe(0);
437
+ return [2 /*return*/];
438
+ });
439
+ }); });
440
+ });
441
+ test('logger with custom level', function () { return __awaiter(void 0, void 0, void 0, function () {
442
+ var mem, sl, logger;
443
+ return __generator(this, function (_a) {
444
+ mem = (0, memory_js_1.createMemoryLogReporter)();
445
+ sl = (0, standardLog_js_1.createStandardLog)({ customLevels: { 'cust_lvl': 100 }, reporters: [mem] });
446
+ logger = sl.getLogger(['cust']);
447
+ logger.cust_lvl('a', 'b');
448
+ assertron_1.assertron.satisfies(mem.logs, [{ id: 'cust', level: 100, args: ['a', 'b'] }]);
449
+ return [2 /*return*/];
450
+ });
451
+ }); });
452
+ describe('getLogger([,{ writeTo }])', function () {
453
+ function testWriteTo(loggerParams, handler) {
454
+ var memReporter = (0, memory_js_1.createMemoryLogReporter)();
455
+ var specialReporter = (0, memory_js_1.createMemoryLogReporter)({ id: 'special' });
456
+ var sl = (0, standardLog_js_1.createStandardLog)({ reporters: [memReporter, specialReporter] });
457
+ var log = sl.getLogger(loggerParams);
458
+ handler(log, memReporter.logs, specialReporter.logs, sl);
459
+ }
460
+ it('can specify which reporter to use by name', function () {
461
+ testWriteTo(['writeTo-string', { writeTo: 'special' }], function (log, memLogs, specialLogs) {
462
+ log.error('error message');
463
+ expect(memLogs.length).toEqual(0);
464
+ expect(specialLogs.length).toEqual(1);
465
+ });
466
+ });
467
+ it('can specify which reporter to use by regex', function () {
468
+ testWriteTo(['writeTo-regex', { writeTo: /^spec/ }], function (log, memLogs, specialLogs) {
469
+ log.error('error message');
470
+ expect(memLogs.length).toEqual(0);
471
+ expect(specialLogs.length).toEqual(1);
472
+ });
473
+ });
474
+ it('can specify which reporter to use by RegExp', function () {
475
+ testWriteTo(['writeTo-RegExp', { writeTo: new RegExp('^spec') }], function (log, memLogs, specialLogs) {
476
+ log.error('error message');
477
+ expect(memLogs.length).toEqual(0);
478
+ expect(specialLogs.length).toEqual(1);
479
+ });
480
+ });
481
+ it('can specify which reporter to use by function', function () {
482
+ testWriteTo(['writeTo-fn', { writeTo: function (id) { return id === 'special'; } }], function (log, memLogs, specialLogs) {
483
+ log.error('error message');
484
+ expect(memLogs.length).toEqual(0);
485
+ expect(specialLogs.length).toEqual(1);
486
+ });
487
+ });
488
+ it('can specify custom reporter', function () {
489
+ var reporter = (0, memory_js_1.createMemoryLogReporter)({ id: 'custom mem' });
490
+ testWriteTo(['writeTo-reporter', { writeTo: reporter }], function (log, memLogs, specialLogs) {
491
+ log.error('error message');
492
+ expect(memLogs.length).toEqual(0);
493
+ expect(specialLogs.length).toEqual(0);
494
+ expect(reporter.logs.length).toEqual(1);
495
+ });
496
+ });
497
+ test('the custom console reporter cannot pick up logs from other loggers', function () {
498
+ // if not, it would be a security issue as the new reporter
499
+ // can capture the logs from other logger and send it elsewhere
500
+ var reporter = (0, memory_js_1.createMemoryLogReporter)({ id: 'custom mem' });
501
+ testWriteTo(['writeTo-reporter-no-override', { writeTo: reporter }], function (_, memLogs, specialLogs, sl) {
502
+ var log = sl.getLogger(['writeTo-reporter-no-override-2']);
503
+ log.error('error message');
504
+ expect(reporter.logs.length).toEqual(0);
505
+ });
506
+ });
507
+ });
508
+ });
509
+ describe('suppressLogs()', function () {
510
+ test('suppress log', function () {
511
+ var sl = (0, standardLog_js_1.createStandardLogForTest)();
512
+ var log = sl.getLogger(['l']);
513
+ (0, standardLog_js_1.suppressLogs)(function () {
514
+ log.alert('should not see me');
515
+ }, log);
516
+ expect(sl.reporter.getLogMessageWithLevel()).toBe('');
517
+ });
518
+ test('suppress multiple logs', function () {
519
+ var sl = (0, standardLog_js_1.createStandardLogForTest)();
520
+ var log1 = sl.getLogger(['l1']);
521
+ var log2 = sl.getLogger(['l2']);
522
+ (0, standardLog_js_1.suppressLogs)(function () {
523
+ log1.alert('should not see me');
524
+ log2.alert('should not see me too');
525
+ }, log1, log2);
526
+ expect(sl.reporter.getLogMessageWithLevel()).toBe('');
527
+ });
528
+ test('return block result', function () {
529
+ var sl = (0, standardLog_js_1.createStandardLogForTest)();
530
+ var log1 = sl.getLogger(['l']);
531
+ var log2 = sl.getLogger(['l2']);
532
+ var a = (0, standardLog_js_1.suppressLogs)(function () { return 1; }, log1, log2);
533
+ expect(a).toBe(1);
534
+ });
535
+ });
536
+ //# sourceMappingURL=standardLog.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standardLog.spec.js","sourceRoot":"","sources":["../ts/standardLog.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA0C;AAC1C,yCAAuC;AACvC,+CAA0D;AAC1D,yCAAqD;AACrD,mDAAyG;AACzG,6CAAmD;AAGnD,QAAQ,CAAC,qBAAqB,EAAE;IAC9B,QAAQ,CAAC,UAAU,EAAE;QACnB,EAAE,CAAC,oBAAoB,EAAE;YACvB,IAAM,MAAM,GAAG,IAAA,kCAAiB,GAAE,CAAA;YAClC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,wBAAS,CAAC,IAAI,CAAC,CAAA;QAC9C,CAAC,CAAC,CAAA;QACF,EAAE,CAAC,aAAa,EAAE;YAChB,IAAM,MAAM,GAAG,IAAA,kCAAiB,GAAE,CAAA;YAClC,qBAAC,CAAC,MAAM,CAAC,cAAM,OAAC,MAAc,CAAC,QAAQ,GAAG,wBAAS,CAAC,MAAM,EAA3C,CAA2C,EAAE,UAAA,GAAG,IAAI,OAAA,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,EAAzB,CAAyB,CAAC,CAAA;QAC/F,CAAC,CAAC,CAAA;QACF,EAAE,CAAC,2BAA2B,EAAE;YAC9B,IAAM,MAAM,GAAG,IAAA,kCAAiB,EAAC,EAAE,QAAQ,EAAE,wBAAS,CAAC,MAAM,EAAE,CAAC,CAAA;YAChE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,wBAAS,CAAC,MAAM,CAAC,CAAA;QAChD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,eAAe,EAAE;QACxB,EAAE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AM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { assertron as a } from 'assertron'\nimport { InvalidId } from './errors.js'\nimport { logLevels, toLogLevelName } from './logLevels.js'\nimport { createMemoryLogReporter } from './memory.js'\nimport { createStandardLog, createStandardLogForTest, StandardLog, suppressLogs } from './standardLog.js'\nimport { assertSSF, wrapTest } from './testUtil.js'\nimport { LogEntry, Logger, LoggerOptions, LogMethodNames } from './types.js'\n\ndescribe('createStandardLog()', () => {\n describe('logLevel', () => {\n it('is default to info', () => {\n const actual = createStandardLog()\n expect(actual.logLevel).toBe(logLevels.info)\n })\n it('is readonly', () => {\n const actual = createStandardLog()\n a.throws(() => (actual as any).logLevel = logLevels.planck, err => /only a getter/.test(err))\n })\n it('set logLevel from options', () => {\n const actual = createStandardLog({ logLevel: logLevels.planck })\n expect(actual.logLevel).toBe(logLevels.planck)\n })\n })\n\n describe('custom levels', () => {\n it('can define custom levels', () => {\n const actual = createStandardLog({ customLevels: { urgent: 80 } })\n\n expect(actual.toLogLevelName(80)).toBe('urgent')\n })\n })\n\n describe('reporters', () => {\n it('can specify reporter', () => {\n const mem = createMemoryLogReporter()\n const sl = createStandardLog({ reporters: [mem] })\n const log = sl.getLogger(['x'])\n log.info('abc')\n expect(mem.logs.length).toBe(1)\n })\n })\n})\n\ndescribe('createStandardLogForTest()', () => {\n it('returns with memory reporter', () => {\n const { reporter } = createStandardLogForTest()\n expect(reporter.getLogMessageWithLevel()).toBe('')\n })\n\n it('defaults to debug', () => {\n const store = createStandardLogForTest()\n expect(store.logLevel).toBe(logLevels.debug)\n })\n})\n\ndescribe('getLogger()', () => {\n it('supports id with alphanumeric and :_-.', () => {\n const sl = createStandardLog()\n sl.getLogger(['abcdefghijklmnopqrstuvwxyz:-_.1234567890'])\n })\n it('supports id with unicode', () => {\n const sl = createStandardLog()\n sl.getLogger(['ミク香港'])\n })\n it('supports id with @, \\\\ and /', () => {\n const sl = createStandardLog()\n sl.getLogger(['@unional/fixture'])\n sl.getLogger([`a\\\\b\\\\c`])\n })\n it.each('`~!#$%^&*()=+|[]{}<>,?'.split(''))('throws if id has unsupported character %s', (char: string) => {\n const sl = createStandardLog()\n a.throws(() => sl.getLogger([char]), InvalidId)\n })\n it('throw InvalidId with ssf to the call site', () => {\n const sl = createStandardLog()\n const err = a.throws(() => sl.getLogger(['!']), InvalidId)\n\n assertSSF(err, __filename)\n })\n test('id is readonly', () => {\n const sl = createStandardLog()\n const log: any = sl.getLogger(['id is readonly'])\n a.throws(() => log.id = 'b')\n })\n\n test('get logger with same name gets the same instance', () => {\n const sl = createStandardLog()\n const expected = sl.getLogger(['same-inst'])\n const actual = sl.getLogger(['same-inst'])\n expect(actual).toBe(expected)\n })\n\n it('can specify local log level', () => {\n const sl = createStandardLog()\n const log = sl.getLogger(['local', { level: logLevels.trace }])\n expect(log.level).toBe(logLevels.trace)\n })\n\n test('new logger will get custom level', () => {\n const sl = createStandardLog({ customLevels: { 'to_logger': 1234 } })\n const actual = sl.getLogger(['to_logger_logger'])\n expect(typeof actual.to_logger).toBe('function')\n })\n\n describe('log levels', () => {\n async function assertLoggedAtLevel(sl: ReturnType<typeof createStandardLogForTest>, method: LogMethodNames, level: number) {\n const log = sl.getLogger([method])\n const msg = `should log on level: ${level}`;\n (log as any)[method](msg)\n a.satisfies(sl.reporter.logs, [{ id: method, level: sl.toLogLevel(method), args: [msg] }])\n }\n\n async function assertNotLoggedAtLevel(sl: ReturnType<typeof createStandardLogForTest>, method: string, level: number) {\n const log = sl.getLogger([method]);\n (log as any)[method](`should not log on level: ${level}`)\n expect(sl.reporter.logs.length).toBe(0)\n }\n\n async function assertLoggedAtLocalLevel(sl: ReturnType<typeof createStandardLogForTest>, method: LogMethodNames, localLevel: number) {\n const log = sl.getLogger([method, { level: localLevel }])\n\n const msg = `should log on level: ${localLevel}`;\n (log as any)[method](msg)\n a.satisfies(sl.reporter.logs, [{ id: log.id, level: sl.toLogLevel(method), args: [msg] }])\n }\n\n async function assertNotLoggedAtLocalLevel(sl: ReturnType<typeof createStandardLogForTest>, method: string, localLevel: number) {\n const log = sl.getLogger([method, { level: localLevel }]);\n (log as any)[method](`should not log on level: ${localLevel}`)\n expect(sl.reporter.logs.length).toBe(0)\n }\n\n async function assertLoggedAtCallLevel(sl: ReturnType<typeof createStandardLogForTest>, method: string, callLevel: number) {\n const log = sl.getLogger([method])\n let actual = false\n log.on(callLevel, () => actual = true)\n expect(actual).toBe(true)\n }\n\n async function assertNotLoggedAtCallLevel(sl: ReturnType<typeof createStandardLogForTest>, method: string, callLevel: number, actualLevel: number) {\n const log = sl.getLogger([method])\n log.on(callLevel, () => { throw new Error(`should not log at level ${actualLevel}`) })\n }\n\n async function assertLoggedAtCallLevelOverrideLocalLevel(sl: ReturnType<typeof createStandardLogForTest>, method: string, localLevel: number, callLevel: number) {\n const log = sl.getLogger([method, { level: localLevel }])\n let actual = false\n log.on(callLevel, () => actual = true)\n expect(actual).toBe(true)\n }\n\n async function assertNotLoggedAtCallLevelOverrideLocalLevel(sl: ReturnType<typeof createStandardLogForTest>, method: string, localLevel: number, callLevel: number) {\n const log = sl.getLogger([method, { level: localLevel }])\n log.on(callLevel, () => { throw new Error(`should not log at level ${localLevel}`) })\n }\n\n const shouldLog = wrapTest((test) => (method: LogMethodNames, level: number) => {\n const sl = createStandardLogForTest(level)\n const name = sl.toLogLevelName(level)\n test(`${method}() should log on level: ${name} (${level})`, () => {\n return assertLoggedAtLevel(sl, method, level)\n })\n })\n const shouldNotLog = wrapTest((test) => (method: string, level: number) => {\n const sl = createStandardLogForTest(level)\n const name = sl.toLogLevelName(level)\n test(`${method}() should not log on level: ${name} (${level})`, () => {\n return assertNotLoggedAtLevel(sl, method, level)\n })\n })\n\n const shouldLogWithLocalLevelOverride = wrapTest((test) => (method: LogMethodNames, localLevel: number) => {\n const localName = toLogLevelName(localLevel);\n [logLevels.none, logLevels.error, logLevels.warn, logLevels.info, logLevels.debug].forEach(globalLevel => {\n const globalName = toLogLevelName(globalLevel) || 'none'\n test(`${method}() should log on local level: ${localName} (${localLevel}) while global level: ${globalName} (${globalLevel})`, () => {\n const sl = createStandardLogForTest(globalLevel)\n return assertLoggedAtLocalLevel(sl, method, localLevel)\n })\n })\n })\n\n const shouldNotLogWithLocalLevelOverride = wrapTest((test) => (method: string, localLevel: number) => {\n const localName = toLogLevelName(localLevel);\n\n [logLevels.none, logLevels.error, logLevels.warn, logLevels.info, logLevels.debug].forEach(globalLevel => {\n const globalName = toLogLevelName(globalLevel) || 'none'\n test(`${method}() should not log on local level: ${localName} (${localLevel}) while global level: ${globalName} (${globalLevel})`, () => {\n const sl = createStandardLogForTest(globalLevel)\n return assertNotLoggedAtLocalLevel(sl, method, localLevel)\n })\n })\n })\n\n const shouldCallLogFunction = wrapTest((test) => (callLevel: number, actualLevel: number) => {\n const method = toLogLevelName(callLevel)\n const name = toLogLevelName(actualLevel)\n test(`${method}() should call log function on level: ${name} (${actualLevel})`, () => {\n const sl = createStandardLogForTest(actualLevel)\n return assertLoggedAtCallLevel(sl, method, callLevel)\n })\n })\n\n const shouldNotCallLogFunction = wrapTest((test) => (callLevel: number, actualLevel: number) => {\n const method = toLogLevelName(callLevel)\n const name = toLogLevelName(actualLevel)\n test(`${method}() should not call log function on level: ${name} (${actualLevel})`, () => {\n const sl = createStandardLogForTest(actualLevel)\n return assertNotLoggedAtCallLevel(sl, method, callLevel, actualLevel)\n })\n })\n\n const shouldCallLogFunctionWithLocalLevelOverride = wrapTest((test) => (callLevel: number, localLevel: number) => {\n const method = toLogLevelName(callLevel)\n const localName = toLogLevelName(localLevel);\n\n [logLevels.none, logLevels.error, logLevels.warn, logLevels.info, logLevels.debug].forEach(globalLevel => {\n const globalName = toLogLevelName(globalLevel) || 'none'\n test(`${method}() should log on local level: ${localName} (${localLevel}) while global level: ${globalName} (${globalLevel})`, () => {\n const sl = createStandardLogForTest(globalLevel)\n return assertLoggedAtCallLevelOverrideLocalLevel(sl, method, localLevel, callLevel)\n })\n })\n })\n\n const shouldNotCallLogFunctionWithLocalLevelOverride = wrapTest((test) => (callLevel: number, localLevel: number) => {\n const method = toLogLevelName(callLevel)\n const localName = toLogLevelName(localLevel);\n\n [logLevels.none, logLevels.error, logLevels.warn, logLevels.info, logLevels.debug].forEach(globalLevel => {\n const globalName = toLogLevelName(globalLevel) || 'none'\n test(`${method}() should not log on local level: ${localName} (${localLevel}) while global level: ${globalName} (${globalLevel})`, () => {\n const sl = createStandardLogForTest(globalLevel)\n return assertNotLoggedAtCallLevelOverrideLocalLevel(sl, method, localLevel, callLevel)\n })\n })\n })\n\n shouldNotLog('error', logLevels.none)\n shouldLog('error', logLevels.error)\n shouldLog('error', logLevels.warn)\n shouldLog('error', logLevels.info)\n shouldLog('error', logLevels.debug)\n shouldNotLogWithLocalLevelOverride('error', logLevels.none)\n shouldLogWithLocalLevelOverride('error', logLevels.error)\n shouldLogWithLocalLevelOverride('error', logLevels.warn)\n shouldLogWithLocalLevelOverride('error', logLevels.info)\n shouldLogWithLocalLevelOverride('error', logLevels.debug)\n\n shouldNotLog('warn', logLevels.none)\n shouldNotLog('warn', logLevels.error)\n shouldLog('warn', logLevels.warn)\n shouldLog('warn', logLevels.info)\n shouldLog('warn', logLevels.debug)\n shouldNotLogWithLocalLevelOverride('warn', logLevels.none)\n shouldNotLogWithLocalLevelOverride('warn', logLevels.error)\n shouldLogWithLocalLevelOverride('warn', logLevels.warn)\n shouldLogWithLocalLevelOverride('warn', logLevels.info)\n shouldLogWithLocalLevelOverride('warn', logLevels.debug)\n\n shouldNotLog('info', logLevels.none)\n shouldNotLog('info', logLevels.error)\n shouldNotLog('info', logLevels.warn)\n shouldLog('info', logLevels.info)\n shouldLog('info', logLevels.debug)\n shouldNotLogWithLocalLevelOverride('info', logLevels.none)\n shouldNotLogWithLocalLevelOverride('info', logLevels.error)\n shouldNotLogWithLocalLevelOverride('info', logLevels.warn)\n shouldLogWithLocalLevelOverride('info', logLevels.info)\n shouldLogWithLocalLevelOverride('info', logLevels.debug)\n\n shouldNotLog('debug', logLevels.none)\n shouldNotLog('debug', logLevels.error)\n shouldNotLog('debug', logLevels.warn)\n shouldNotLog('debug', logLevels.info)\n shouldLog('debug', logLevels.debug)\n shouldNotLogWithLocalLevelOverride('debug', logLevels.none)\n shouldNotLogWithLocalLevelOverride('debug', logLevels.error)\n shouldNotLogWithLocalLevelOverride('debug', logLevels.warn)\n shouldNotLogWithLocalLevelOverride('debug', logLevels.info)\n shouldLogWithLocalLevelOverride('debug', logLevels.debug)\n\n shouldNotCallLogFunction(logLevels.error, logLevels.none)\n shouldCallLogFunction(logLevels.error, logLevels.error)\n shouldCallLogFunction(logLevels.error, logLevels.warn)\n shouldCallLogFunction(logLevels.error, logLevels.info)\n shouldCallLogFunction(logLevels.error, logLevels.debug)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.error, logLevels.none)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.error, logLevels.error)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.error, logLevels.warn)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.error, logLevels.info)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.error, logLevels.debug)\n\n shouldNotCallLogFunction(logLevels.warn, logLevels.none)\n shouldNotCallLogFunction(logLevels.warn, logLevels.error)\n shouldCallLogFunction(logLevels.warn, logLevels.warn)\n shouldCallLogFunction(logLevels.warn, logLevels.info)\n shouldCallLogFunction(logLevels.warn, logLevels.debug)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.warn, logLevels.none)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.warn, logLevels.error)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.warn, logLevels.warn)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.warn, logLevels.info)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.warn, logLevels.debug)\n\n shouldNotCallLogFunction(logLevels.info, logLevels.none)\n shouldNotCallLogFunction(logLevels.info, logLevels.error)\n shouldNotCallLogFunction(logLevels.info, logLevels.warn)\n shouldCallLogFunction(logLevels.info, logLevels.info)\n shouldCallLogFunction(logLevels.info, logLevels.debug)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.info, logLevels.none)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.info, logLevels.error)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.info, logLevels.warn)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.info, logLevels.info)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.info, logLevels.debug)\n\n shouldNotCallLogFunction(logLevels.debug, logLevels.none)\n shouldNotCallLogFunction(logLevels.debug, logLevels.error)\n shouldNotCallLogFunction(logLevels.debug, logLevels.warn)\n shouldNotCallLogFunction(logLevels.debug, logLevels.info)\n shouldCallLogFunction(logLevels.debug, logLevels.debug)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.debug, logLevels.none)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.debug, logLevels.error)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.debug, logLevels.warn)\n shouldNotCallLogFunctionWithLocalLevelOverride(logLevels.debug, logLevels.info)\n shouldCallLogFunctionWithLocalLevelOverride(logLevels.debug, logLevels.debug)\n })\n\n it('writes entry directly', () => {\n const sl = createStandardLogForTest()\n const log = sl.getLogger(['write-entry'])\n const entry = { id: 'write-entry', level: logLevels.info, args: ['abc'], timestamp: new Date() }\n log.write(entry)\n a.satisfies(sl.reporter.logs, [entry])\n })\n test.each(['on', 'count', 'error', 'warn', 'info', 'debug'])('method %s is readonly', name => {\n const sl = createStandardLog()\n const log: any = sl.getLogger([`${name} is readonly`])\n\n a.throws(() => log[name] = true)\n })\n\n\n describe('on()', () => {\n it('log using log argument', () => {\n const sl = createStandardLogForTest()\n const logger = sl.getLogger(['log on fn'])\n logger.on('error', log => { log('value') })\n\n a.satisfies(sl.reporter.logs, [\n { id: 'log on fn', level: logLevels.error, args: ['value'] }\n ])\n })\n it('can take log level name in first argument', () => {\n const sl = createStandardLogForTest()\n const log = sl.getLogger(['string-on'])\n log.on('debug', () => { return })\n })\n })\n describe('count()', () => {\n test('will increment the counter', async () => {\n const sl = createStandardLogForTest()\n const logger = sl.getLogger(['inc counter'])\n\n logger.count()\n logger.count()\n\n a.satisfies(sl.reporter.logs, [\n { id: 'inc counter', level: logLevels.debug, args: [1] },\n { id: 'inc counter', level: logLevels.debug, args: [2] }\n ])\n })\n\n test('append args after the counter', async () => {\n const sl = createStandardLogForTest(logLevels.debug)\n const id = 'inc with args'\n const logger = sl.getLogger([id])\n logger.count('msg1', 'msg2')\n\n a.satisfies(sl.reporter.logs, [\n { id, level: logLevels.debug, args: [1, 'msg1', 'msg2'] }\n ])\n })\n\n test('not log if log level is less than debug', async () => {\n const sl = createStandardLogForTest(logLevels.debug - 1)\n const id = 'inc with args'\n const logger = sl.getLogger([id])\n logger.count('msg1', 'msg2')\n\n expect(sl.reporter.logs.length).toBe(0)\n })\n })\n\n test('logger with custom level', async () => {\n const mem = createMemoryLogReporter()\n const sl = createStandardLog({ customLevels: { 'cust_lvl': 100 }, reporters: [mem] })\n const logger = sl.getLogger(['cust'])\n logger.cust_lvl('a', 'b')\n\n a.satisfies(mem.logs, [{ id: 'cust', level: 100, args: ['a', 'b'] }])\n })\n\n describe('getLogger([,{ writeTo }])', () => {\n function testWriteTo(\n loggerParams: [id: string, options: LoggerOptions],\n handler: (log: Logger, memLogs: LogEntry[], specialLogs: LogEntry[], sl: StandardLog) => void\n ) {\n const memReporter = createMemoryLogReporter()\n const specialReporter = createMemoryLogReporter({ id: 'special' })\n const sl = createStandardLog({ reporters: [memReporter, specialReporter] })\n\n const log = sl.getLogger(loggerParams)\n handler(log, memReporter.logs, specialReporter.logs, sl)\n }\n it('can specify which reporter to use by name', () => {\n testWriteTo(['writeTo-string', { writeTo: 'special' }], (log, memLogs, specialLogs) => {\n log.error('error message')\n expect(memLogs.length).toEqual(0)\n expect(specialLogs.length).toEqual(1)\n })\n })\n it('can specify which reporter to use by regex', () => {\n testWriteTo(['writeTo-regex', { writeTo: /^spec/ }], (log, memLogs, specialLogs) => {\n log.error('error message')\n expect(memLogs.length).toEqual(0)\n expect(specialLogs.length).toEqual(1)\n })\n })\n it('can specify which reporter to use by RegExp', () => {\n testWriteTo(['writeTo-RegExp', { writeTo: new RegExp('^spec') }], (log, memLogs, specialLogs) => {\n log.error('error message')\n expect(memLogs.length).toEqual(0)\n expect(specialLogs.length).toEqual(1)\n })\n })\n it('can specify which reporter to use by function', () => {\n testWriteTo(['writeTo-fn', { writeTo: id => id === 'special' }],\n (log, memLogs, specialLogs) => {\n log.error('error message')\n expect(memLogs.length).toEqual(0)\n expect(specialLogs.length).toEqual(1)\n })\n })\n it('can specify custom reporter', () => {\n const reporter = createMemoryLogReporter({ id: 'custom mem' })\n testWriteTo(['writeTo-reporter', { writeTo: reporter }],\n (log, memLogs, specialLogs) => {\n log.error('error message')\n expect(memLogs.length).toEqual(0)\n expect(specialLogs.length).toEqual(0)\n expect(reporter.logs.length).toEqual(1)\n })\n })\n\n test('the custom console reporter cannot pick up logs from other loggers', () => {\n // if not, it would be a security issue as the new reporter\n // can capture the logs from other logger and send it elsewhere\n const reporter = createMemoryLogReporter({ id: 'custom mem' });\n testWriteTo(['writeTo-reporter-no-override', { writeTo: reporter }],\n (_, memLogs, specialLogs, sl) => {\n const log = sl.getLogger(['writeTo-reporter-no-override-2'])\n log.error('error message')\n\n expect(reporter.logs.length).toEqual(0)\n })\n })\n })\n})\n\ndescribe('suppressLogs()', () => {\n test('suppress log', () => {\n const sl = createStandardLogForTest()\n const log = sl.getLogger(['l'])\n suppressLogs(() => {\n log.alert('should not see me')\n }, log)\n\n expect(sl.reporter.getLogMessageWithLevel()).toBe('')\n })\n\n test('suppress multiple logs', () => {\n const sl = createStandardLogForTest()\n const log1 = sl.getLogger(['l1'])\n const log2 = sl.getLogger(['l2'])\n suppressLogs(() => {\n log1.alert('should not see me')\n log2.alert('should not see me too')\n }, log1, log2)\n expect(sl.reporter.getLogMessageWithLevel()).toBe('')\n })\n\n test('return block result', () => {\n const sl = createStandardLogForTest()\n const log1 = sl.getLogger(['l'])\n const log2 = sl.getLogger(['l2'])\n const a = suppressLogs(() => 1, log1, log2)\n expect(a).toBe(1)\n })\n})\n"]}