standard-log 7.0.2 → 8.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 (833) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +14 -1
  3. package/{lib → cjs}/LogEntry.d.ts +0 -0
  4. package/cjs/LogEntry.d.ts.map +1 -0
  5. package/{lib → cjs}/LogEntry.js +0 -0
  6. package/cjs/LogEntry.js.map +1 -0
  7. package/cjs/captureLogs.d.ts +4 -0
  8. package/cjs/captureLogs.d.ts.map +1 -0
  9. package/cjs/captureLogs.js +33 -0
  10. package/cjs/captureLogs.js.map +1 -0
  11. package/cjs/captureLogs.spec.d.ts +2 -0
  12. package/cjs/captureLogs.spec.d.ts.map +1 -0
  13. package/cjs/captureLogs.spec.js +117 -0
  14. package/cjs/captureLogs.spec.js.map +1 -0
  15. package/cjs/config.d.ts +12 -0
  16. package/cjs/config.d.ts.map +1 -0
  17. package/cjs/config.js +59 -0
  18. package/cjs/config.js.map +1 -0
  19. package/cjs/config.spec.d.ts +2 -0
  20. package/cjs/config.spec.d.ts.map +1 -0
  21. package/cjs/config.spec.js +66 -0
  22. package/cjs/config.spec.js.map +1 -0
  23. package/cjs/configForTest.d.ts +5 -0
  24. package/cjs/configForTest.d.ts.map +1 -0
  25. package/cjs/configForTest.js +18 -0
  26. package/cjs/configForTest.js.map +1 -0
  27. package/cjs/configForTest.spec.d.ts +2 -0
  28. package/cjs/configForTest.spec.d.ts.map +1 -0
  29. package/cjs/configForTest.spec.js +17 -0
  30. package/cjs/configForTest.spec.js.map +1 -0
  31. package/cjs/console/createConsoleLogReporter.d.ts +9 -0
  32. package/cjs/console/createConsoleLogReporter.d.ts.map +1 -0
  33. package/cjs/console/createConsoleLogReporter.js +42 -0
  34. package/cjs/console/createConsoleLogReporter.js.map +1 -0
  35. package/cjs/console/createConsoleLogReporter.spec.d.ts +2 -0
  36. package/cjs/console/createConsoleLogReporter.spec.d.ts.map +1 -0
  37. package/cjs/console/createConsoleLogReporter.spec.js +182 -0
  38. package/cjs/console/createConsoleLogReporter.spec.js.map +1 -0
  39. package/cjs/console/index.d.ts +4 -0
  40. package/cjs/console/index.d.ts.map +1 -0
  41. package/cjs/console/index.js +20 -0
  42. package/cjs/console/index.js.map +1 -0
  43. package/{lib → cjs}/console/isConsoleDebugAvailable.d.ts +0 -0
  44. package/cjs/console/isConsoleDebugAvailable.d.ts.map +1 -0
  45. package/cjs/console/isConsoleDebugAvailable.js +20 -0
  46. package/cjs/console/isConsoleDebugAvailable.js.map +1 -0
  47. package/{lib → cjs}/console/polyfilledConsole.d.ts +0 -0
  48. package/cjs/console/polyfilledConsole.d.ts.map +1 -0
  49. package/cjs/console/polyfilledConsole.js +41 -0
  50. package/cjs/console/polyfilledConsole.js.map +1 -0
  51. package/{lib → cjs}/console/semverGt.d.ts +0 -0
  52. package/cjs/console/semverGt.d.ts.map +1 -0
  53. package/{lib → cjs}/console/semverGt.js +0 -0
  54. package/cjs/console/semverGt.js.map +1 -0
  55. package/cjs/console/semverGt.spec.d.ts +2 -0
  56. package/cjs/console/semverGt.spec.d.ts.map +1 -0
  57. package/cjs/console/semverGt.spec.js +22 -0
  58. package/cjs/console/semverGt.spec.js.map +1 -0
  59. package/{lib → cjs}/console/toConsoleMethod.d.ts +0 -0
  60. package/cjs/console/toConsoleMethod.d.ts.map +1 -0
  61. package/cjs/console/toConsoleMethod.js +22 -0
  62. package/cjs/console/toConsoleMethod.js.map +1 -0
  63. package/cjs/console/types.d.ts +3 -0
  64. package/cjs/console/types.d.ts.map +1 -0
  65. package/{lib → cjs}/console/types.js +0 -0
  66. package/cjs/console/types.js.map +1 -0
  67. package/cjs/customLogLevel.d.ts +11 -0
  68. package/cjs/customLogLevel.d.ts.map +1 -0
  69. package/cjs/customLogLevel.js +38 -0
  70. package/cjs/customLogLevel.js.map +1 -0
  71. package/cjs/customLogLevel.spec.d.ts +2 -0
  72. package/cjs/customLogLevel.spec.d.ts.map +1 -0
  73. package/cjs/customLogLevel.spec.js +37 -0
  74. package/cjs/customLogLevel.spec.js.map +1 -0
  75. package/{lib → cjs}/errors.d.ts +0 -0
  76. package/cjs/errors.d.ts.map +1 -0
  77. package/cjs/errors.js +85 -0
  78. package/cjs/errors.js.map +1 -0
  79. package/{lib → cjs}/formatter/createTimestampFormatter.d.ts +0 -0
  80. package/cjs/formatter/createTimestampFormatter.d.ts.map +1 -0
  81. package/cjs/formatter/createTimestampFormatter.js +26 -0
  82. package/cjs/formatter/createTimestampFormatter.js.map +1 -0
  83. package/cjs/formatter/createTimestampFormatter.spec.d.ts +2 -0
  84. package/cjs/formatter/createTimestampFormatter.spec.d.ts.map +1 -0
  85. package/cjs/formatter/createTimestampFormatter.spec.js +23 -0
  86. package/cjs/formatter/createTimestampFormatter.spec.js.map +1 -0
  87. package/{lib → cjs}/formatter/formatLogLevel.d.ts +0 -0
  88. package/cjs/formatter/formatLogLevel.d.ts.map +1 -0
  89. package/cjs/formatter/formatLogLevel.js +10 -0
  90. package/cjs/formatter/formatLogLevel.js.map +1 -0
  91. package/cjs/formatter/index.d.ts +4 -0
  92. package/cjs/formatter/index.d.ts.map +1 -0
  93. package/cjs/formatter/index.js +20 -0
  94. package/cjs/formatter/index.js.map +1 -0
  95. package/cjs/formatter/plainLogFormatter.d.ts +3 -0
  96. package/cjs/formatter/plainLogFormatter.d.ts.map +1 -0
  97. package/cjs/formatter/plainLogFormatter.js +19 -0
  98. package/cjs/formatter/plainLogFormatter.js.map +1 -0
  99. package/cjs/formatter/plainLogFormatter.spec.d.ts +2 -0
  100. package/cjs/formatter/plainLogFormatter.spec.d.ts.map +1 -0
  101. package/cjs/formatter/plainLogFormatter.spec.js +9 -0
  102. package/cjs/formatter/plainLogFormatter.spec.js.map +1 -0
  103. package/{lib → cjs}/getDefaultReporter.browser.d.ts +0 -0
  104. package/cjs/getDefaultReporter.browser.d.ts.map +1 -0
  105. package/cjs/getDefaultReporter.browser.js +15 -0
  106. package/cjs/getDefaultReporter.browser.js.map +1 -0
  107. package/{lib → cjs}/getDefaultReporter.d.ts +0 -0
  108. package/cjs/getDefaultReporter.d.ts.map +1 -0
  109. package/cjs/getDefaultReporter.js +19 -0
  110. package/cjs/getDefaultReporter.js.map +1 -0
  111. package/cjs/getLogModeFromEnvironment.browser.d.ts +3 -0
  112. package/cjs/getLogModeFromEnvironment.browser.d.ts.map +1 -0
  113. package/{lib → cjs}/getLogModeFromEnvironment.browser.js +0 -0
  114. package/cjs/getLogModeFromEnvironment.browser.js.map +1 -0
  115. package/cjs/getLogModeFromEnvironment.d.ts +3 -0
  116. package/cjs/getLogModeFromEnvironment.d.ts.map +1 -0
  117. package/cjs/getLogModeFromEnvironment.js +17 -0
  118. package/cjs/getLogModeFromEnvironment.js.map +1 -0
  119. package/cjs/getLogModeFromEnvironment.spec.d.ts +2 -0
  120. package/cjs/getLogModeFromEnvironment.spec.d.ts.map +1 -0
  121. package/cjs/getLogModeFromEnvironment.spec.js +19 -0
  122. package/cjs/getLogModeFromEnvironment.spec.js.map +1 -0
  123. package/cjs/getLogger.d.ts +9 -0
  124. package/cjs/getLogger.d.ts.map +1 -0
  125. package/cjs/getLogger.js +103 -0
  126. package/cjs/getLogger.js.map +1 -0
  127. package/cjs/getLogger.spec.d.ts +2 -0
  128. package/cjs/getLogger.spec.d.ts.map +1 -0
  129. package/cjs/getLogger.spec.js +481 -0
  130. package/cjs/getLogger.spec.js.map +1 -0
  131. package/cjs/getLoggers.d.ts +7 -0
  132. package/cjs/getLoggers.d.ts.map +1 -0
  133. package/cjs/getLoggers.js +15 -0
  134. package/cjs/getLoggers.js.map +1 -0
  135. package/cjs/index.d.ts +17 -0
  136. package/cjs/index.d.ts.map +1 -0
  137. package/cjs/index.js +33 -0
  138. package/cjs/index.js.map +1 -0
  139. package/{lib → cjs}/logLevel.d.ts +0 -0
  140. package/cjs/logLevel.d.ts.map +1 -0
  141. package/{lib → cjs}/logLevel.js +0 -0
  142. package/cjs/logLevel.js.map +1 -0
  143. package/cjs/logLevel.spec.d.ts +2 -0
  144. package/cjs/logLevel.spec.d.ts.map +1 -0
  145. package/cjs/logLevel.spec.js +195 -0
  146. package/cjs/logLevel.spec.js.map +1 -0
  147. package/cjs/logLevelFn.d.ts +20 -0
  148. package/cjs/logLevelFn.d.ts.map +1 -0
  149. package/cjs/logLevelFn.js +76 -0
  150. package/cjs/logLevelFn.js.map +1 -0
  151. package/cjs/logReporter.d.ts +7 -0
  152. package/cjs/logReporter.d.ts.map +1 -0
  153. package/cjs/logReporter.js +29 -0
  154. package/cjs/logReporter.js.map +1 -0
  155. package/cjs/logReporter.spec.d.ts +2 -0
  156. package/cjs/logReporter.spec.d.ts.map +1 -0
  157. package/cjs/logReporter.spec.js +86 -0
  158. package/cjs/logReporter.spec.js.map +1 -0
  159. package/cjs/logReporterInternal.d.ts +3 -0
  160. package/cjs/logReporterInternal.d.ts.map +1 -0
  161. package/cjs/logReporterInternal.js +23 -0
  162. package/cjs/logReporterInternal.js.map +1 -0
  163. package/cjs/memory/MemoryLogReporter.d.ts +14 -0
  164. package/cjs/memory/MemoryLogReporter.d.ts.map +1 -0
  165. package/cjs/memory/MemoryLogReporter.js +56 -0
  166. package/cjs/memory/MemoryLogReporter.js.map +1 -0
  167. package/cjs/memory/MemoryLogReporter.spec.d.ts +2 -0
  168. package/cjs/memory/MemoryLogReporter.spec.d.ts.map +1 -0
  169. package/cjs/memory/MemoryLogReporter.spec.js +111 -0
  170. package/cjs/memory/MemoryLogReporter.spec.js.map +1 -0
  171. package/cjs/memory/index.d.ts +3 -0
  172. package/cjs/memory/index.d.ts.map +1 -0
  173. package/cjs/memory/index.js +19 -0
  174. package/cjs/memory/index.js.map +1 -0
  175. package/cjs/memory/logEntriesToString.d.ts +3 -0
  176. package/cjs/memory/logEntriesToString.d.ts.map +1 -0
  177. package/cjs/memory/logEntriesToString.js +10 -0
  178. package/cjs/memory/logEntriesToString.js.map +1 -0
  179. package/cjs/memory/logEntriesToString.spec.d.ts +2 -0
  180. package/cjs/memory/logEntriesToString.spec.d.ts.map +1 -0
  181. package/cjs/memory/logEntriesToString.spec.js +36 -0
  182. package/cjs/memory/logEntriesToString.spec.js.map +1 -0
  183. package/cjs/memory/toInspectStringForObject.d.ts +3 -0
  184. package/cjs/memory/toInspectStringForObject.d.ts.map +1 -0
  185. package/cjs/memory/toInspectStringForObject.js +17 -0
  186. package/cjs/memory/toInspectStringForObject.js.map +1 -0
  187. package/cjs/package.json +3 -0
  188. package/cjs/shouldLog.d.ts +8 -0
  189. package/cjs/shouldLog.d.ts.map +1 -0
  190. package/cjs/shouldLog.js +14 -0
  191. package/cjs/shouldLog.js.map +1 -0
  192. package/cjs/store.d.ts +3 -0
  193. package/cjs/store.d.ts.map +1 -0
  194. package/cjs/store.js +27 -0
  195. package/cjs/store.js.map +1 -0
  196. package/cjs/suppressLogs.d.ts +6 -0
  197. package/cjs/suppressLogs.d.ts.map +1 -0
  198. package/cjs/suppressLogs.js +17 -0
  199. package/cjs/suppressLogs.js.map +1 -0
  200. package/cjs/suppressLogs.spec.d.ts +2 -0
  201. package/cjs/suppressLogs.spec.d.ts.map +1 -0
  202. package/cjs/suppressLogs.spec.js +31 -0
  203. package/cjs/suppressLogs.spec.js.map +1 -0
  204. package/cjs/testUtil.d.ts +7 -0
  205. package/cjs/testUtil.d.ts.map +1 -0
  206. package/cjs/testUtil.js +25 -0
  207. package/cjs/testUtil.js.map +1 -0
  208. package/{lib → cjs}/types.d.ts +0 -0
  209. package/cjs/types.d.ts.map +1 -0
  210. package/{lib → cjs}/types.js +0 -0
  211. package/cjs/types.js.map +1 -0
  212. package/cjs/types.spec.d.ts +2 -0
  213. package/cjs/types.spec.d.ts.map +1 -0
  214. package/cjs/types.spec.js +7 -0
  215. package/cjs/types.spec.js.map +1 -0
  216. package/cjs/typesInternal.d.ts +20 -0
  217. package/cjs/typesInternal.d.ts.map +1 -0
  218. package/{lib → cjs}/typesInternal.js +0 -0
  219. package/cjs/typesInternal.js.map +1 -0
  220. package/{lib → cjs}/utils.d.ts +0 -0
  221. package/cjs/utils.d.ts.map +1 -0
  222. package/cjs/utils.js +14 -0
  223. package/cjs/utils.js.map +1 -0
  224. package/cjs/writeToReporters.d.ts +6 -0
  225. package/cjs/writeToReporters.d.ts.map +1 -0
  226. package/cjs/writeToReporters.js +22 -0
  227. package/cjs/writeToReporters.js.map +1 -0
  228. package/cjs/writeToReporters.spec.d.ts +2 -0
  229. package/cjs/writeToReporters.spec.d.ts.map +1 -0
  230. package/cjs/writeToReporters.spec.js +59 -0
  231. package/cjs/writeToReporters.spec.js.map +1 -0
  232. package/dist/standard-log.es5.js +2724 -0
  233. package/dist/standard-log.es5.js.gz +0 -0
  234. package/dist/standard-log.es5.js.map +1 -0
  235. package/dist/standard-log.es5.js.map.gz +0 -0
  236. package/dist/standard-log.esm.js +2724 -0
  237. package/dist/standard-log.esm.js.gz +0 -0
  238. package/dist/standard-log.esm.js.map +1 -0
  239. package/dist/standard-log.esm.js.map.gz +0 -0
  240. package/{libm → esm}/LogEntry.d.ts +0 -0
  241. package/esm/LogEntry.d.ts.map +1 -0
  242. package/{libm → esm}/LogEntry.js +0 -0
  243. package/esm/LogEntry.js.map +1 -0
  244. package/esm/captureLogs.d.ts +4 -0
  245. package/esm/captureLogs.d.ts.map +1 -0
  246. package/esm/captureLogs.js +29 -0
  247. package/esm/captureLogs.js.map +1 -0
  248. package/esm/captureLogs.spec.d.ts +2 -0
  249. package/esm/captureLogs.spec.d.ts.map +1 -0
  250. package/esm/captureLogs.spec.js +45 -0
  251. package/esm/captureLogs.spec.js.map +1 -0
  252. package/esm/config.d.ts +12 -0
  253. package/esm/config.d.ts.map +1 -0
  254. package/esm/config.js +44 -0
  255. package/esm/config.js.map +1 -0
  256. package/esm/config.spec.d.ts +2 -0
  257. package/esm/config.spec.d.ts.map +1 -0
  258. package/esm/config.spec.js +61 -0
  259. package/esm/config.spec.js.map +1 -0
  260. package/esm/configForTest.d.ts +5 -0
  261. package/esm/configForTest.d.ts.map +1 -0
  262. package/esm/configForTest.js +14 -0
  263. package/esm/configForTest.js.map +1 -0
  264. package/esm/configForTest.spec.d.ts +2 -0
  265. package/esm/configForTest.spec.d.ts.map +1 -0
  266. package/esm/configForTest.spec.js +15 -0
  267. package/esm/configForTest.spec.js.map +1 -0
  268. package/esm/console/createConsoleLogReporter.d.ts +9 -0
  269. package/esm/console/createConsoleLogReporter.d.ts.map +1 -0
  270. package/esm/console/createConsoleLogReporter.js +37 -0
  271. package/esm/console/createConsoleLogReporter.js.map +1 -0
  272. package/esm/console/createConsoleLogReporter.spec.d.ts +2 -0
  273. package/esm/console/createConsoleLogReporter.spec.d.ts.map +1 -0
  274. package/esm/console/createConsoleLogReporter.spec.js +153 -0
  275. package/esm/console/createConsoleLogReporter.spec.js.map +1 -0
  276. package/esm/console/index.d.ts +4 -0
  277. package/esm/console/index.d.ts.map +1 -0
  278. package/esm/console/index.js +4 -0
  279. package/esm/console/index.js.map +1 -0
  280. package/{libm → esm}/console/isConsoleDebugAvailable.d.ts +0 -0
  281. package/esm/console/isConsoleDebugAvailable.d.ts.map +1 -0
  282. package/esm/console/isConsoleDebugAvailable.js +13 -0
  283. package/esm/console/isConsoleDebugAvailable.js.map +1 -0
  284. package/{libm → esm}/console/polyfilledConsole.d.ts +0 -0
  285. package/esm/console/polyfilledConsole.d.ts.map +1 -0
  286. package/esm/console/polyfilledConsole.js +32 -0
  287. package/esm/console/polyfilledConsole.js.map +1 -0
  288. package/{libm → esm}/console/semverGt.d.ts +0 -0
  289. package/esm/console/semverGt.d.ts.map +1 -0
  290. package/{libm → esm}/console/semverGt.js +0 -0
  291. package/esm/console/semverGt.js.map +1 -0
  292. package/esm/console/semverGt.spec.d.ts +2 -0
  293. package/esm/console/semverGt.spec.d.ts.map +1 -0
  294. package/esm/console/semverGt.spec.js +20 -0
  295. package/esm/console/semverGt.spec.js.map +1 -0
  296. package/{libm → esm}/console/toConsoleMethod.d.ts +0 -0
  297. package/esm/console/toConsoleMethod.d.ts.map +1 -0
  298. package/esm/console/toConsoleMethod.js +18 -0
  299. package/esm/console/toConsoleMethod.js.map +1 -0
  300. package/esm/console/types.d.ts +3 -0
  301. package/esm/console/types.d.ts.map +1 -0
  302. package/{libm → esm}/console/types.js +0 -0
  303. package/esm/console/types.js.map +1 -0
  304. package/esm/customLogLevel.d.ts +11 -0
  305. package/esm/customLogLevel.d.ts.map +1 -0
  306. package/esm/customLogLevel.js +30 -0
  307. package/esm/customLogLevel.js.map +1 -0
  308. package/esm/customLogLevel.spec.d.ts +2 -0
  309. package/esm/customLogLevel.spec.d.ts.map +1 -0
  310. package/esm/customLogLevel.spec.js +32 -0
  311. package/esm/customLogLevel.spec.js.map +1 -0
  312. package/{libm → esm}/errors.d.ts +0 -0
  313. package/esm/errors.d.ts.map +1 -0
  314. package/esm/errors.js +52 -0
  315. package/esm/errors.js.map +1 -0
  316. package/{libm → esm}/formatter/createTimestampFormatter.d.ts +0 -0
  317. package/esm/formatter/createTimestampFormatter.d.ts.map +1 -0
  318. package/{libm → esm}/formatter/createTimestampFormatter.js +0 -0
  319. package/esm/formatter/createTimestampFormatter.js.map +1 -0
  320. package/esm/formatter/createTimestampFormatter.spec.d.ts +2 -0
  321. package/esm/formatter/createTimestampFormatter.spec.d.ts.map +1 -0
  322. package/esm/formatter/createTimestampFormatter.spec.js +21 -0
  323. package/esm/formatter/createTimestampFormatter.spec.js.map +1 -0
  324. package/{libm → esm}/formatter/formatLogLevel.d.ts +0 -0
  325. package/esm/formatter/formatLogLevel.d.ts.map +1 -0
  326. package/esm/formatter/formatLogLevel.js +6 -0
  327. package/esm/formatter/formatLogLevel.js.map +1 -0
  328. package/esm/formatter/index.d.ts +4 -0
  329. package/esm/formatter/index.d.ts.map +1 -0
  330. package/esm/formatter/index.js +4 -0
  331. package/esm/formatter/index.js.map +1 -0
  332. package/esm/formatter/plainLogFormatter.d.ts +3 -0
  333. package/esm/formatter/plainLogFormatter.d.ts.map +1 -0
  334. package/esm/formatter/plainLogFormatter.js +5 -0
  335. package/esm/formatter/plainLogFormatter.js.map +1 -0
  336. package/esm/formatter/plainLogFormatter.spec.d.ts +2 -0
  337. package/esm/formatter/plainLogFormatter.spec.d.ts.map +1 -0
  338. package/esm/formatter/plainLogFormatter.spec.js +7 -0
  339. package/esm/formatter/plainLogFormatter.spec.js.map +1 -0
  340. package/{libm → esm}/getDefaultReporter.browser.d.ts +0 -0
  341. package/esm/getDefaultReporter.browser.d.ts.map +1 -0
  342. package/esm/getDefaultReporter.browser.js +11 -0
  343. package/esm/getDefaultReporter.browser.js.map +1 -0
  344. package/{libm → esm}/getDefaultReporter.d.ts +0 -0
  345. package/esm/getDefaultReporter.d.ts.map +1 -0
  346. package/esm/getDefaultReporter.js +15 -0
  347. package/esm/getDefaultReporter.js.map +1 -0
  348. package/esm/getLogModeFromEnvironment.browser.d.ts +3 -0
  349. package/esm/getLogModeFromEnvironment.browser.d.ts.map +1 -0
  350. package/{libm → esm}/getLogModeFromEnvironment.browser.js +0 -0
  351. package/esm/getLogModeFromEnvironment.browser.js.map +1 -0
  352. package/esm/getLogModeFromEnvironment.d.ts +3 -0
  353. package/esm/getLogModeFromEnvironment.d.ts.map +1 -0
  354. package/esm/getLogModeFromEnvironment.js +13 -0
  355. package/esm/getLogModeFromEnvironment.js.map +1 -0
  356. package/esm/getLogModeFromEnvironment.spec.d.ts +2 -0
  357. package/esm/getLogModeFromEnvironment.spec.d.ts.map +1 -0
  358. package/esm/getLogModeFromEnvironment.spec.js +14 -0
  359. package/esm/getLogModeFromEnvironment.spec.js.map +1 -0
  360. package/esm/getLogger.d.ts +9 -0
  361. package/esm/getLogger.d.ts.map +1 -0
  362. package/esm/getLogger.js +78 -0
  363. package/esm/getLogger.js.map +1 -0
  364. package/esm/getLogger.spec.d.ts +2 -0
  365. package/esm/getLogger.spec.d.ts.map +1 -0
  366. package/esm/getLogger.spec.js +381 -0
  367. package/esm/getLogger.spec.js.map +1 -0
  368. package/esm/getLoggers.d.ts +7 -0
  369. package/esm/getLoggers.d.ts.map +1 -0
  370. package/esm/getLoggers.js +11 -0
  371. package/esm/getLoggers.js.map +1 -0
  372. package/esm/index.d.ts +17 -0
  373. package/esm/index.d.ts.map +1 -0
  374. package/esm/index.js +17 -0
  375. package/esm/index.js.map +1 -0
  376. package/{libm → esm}/logLevel.d.ts +0 -0
  377. package/esm/logLevel.d.ts.map +1 -0
  378. package/{libm → esm}/logLevel.js +0 -0
  379. package/esm/logLevel.js.map +1 -0
  380. package/esm/logLevel.spec.d.ts +2 -0
  381. package/esm/logLevel.spec.d.ts.map +1 -0
  382. package/esm/logLevel.spec.js +148 -0
  383. package/esm/logLevel.spec.js.map +1 -0
  384. package/esm/logLevelFn.d.ts +20 -0
  385. package/esm/logLevelFn.d.ts.map +1 -0
  386. package/esm/logLevelFn.js +67 -0
  387. package/esm/logLevelFn.js.map +1 -0
  388. package/esm/logReporter.d.ts +7 -0
  389. package/esm/logReporter.d.ts.map +1 -0
  390. package/esm/logReporter.js +21 -0
  391. package/esm/logReporter.js.map +1 -0
  392. package/esm/logReporter.spec.d.ts +2 -0
  393. package/esm/logReporter.spec.d.ts.map +1 -0
  394. package/esm/logReporter.spec.js +81 -0
  395. package/esm/logReporter.spec.js.map +1 -0
  396. package/esm/logReporterInternal.d.ts +3 -0
  397. package/esm/logReporterInternal.d.ts.map +1 -0
  398. package/esm/logReporterInternal.js +19 -0
  399. package/esm/logReporterInternal.js.map +1 -0
  400. package/esm/memory/MemoryLogReporter.d.ts +14 -0
  401. package/esm/memory/MemoryLogReporter.d.ts.map +1 -0
  402. package/esm/memory/MemoryLogReporter.js +51 -0
  403. package/esm/memory/MemoryLogReporter.js.map +1 -0
  404. package/esm/memory/MemoryLogReporter.spec.d.ts +2 -0
  405. package/esm/memory/MemoryLogReporter.spec.d.ts.map +1 -0
  406. package/esm/memory/MemoryLogReporter.spec.js +98 -0
  407. package/esm/memory/MemoryLogReporter.spec.js.map +1 -0
  408. package/esm/memory/index.d.ts +3 -0
  409. package/esm/memory/index.d.ts.map +1 -0
  410. package/esm/memory/index.js +3 -0
  411. package/esm/memory/index.js.map +1 -0
  412. package/esm/memory/logEntriesToString.d.ts +3 -0
  413. package/esm/memory/logEntriesToString.d.ts.map +1 -0
  414. package/esm/memory/logEntriesToString.js +6 -0
  415. package/esm/memory/logEntriesToString.js.map +1 -0
  416. package/esm/memory/logEntriesToString.spec.d.ts +2 -0
  417. package/esm/memory/logEntriesToString.spec.d.ts.map +1 -0
  418. package/esm/memory/logEntriesToString.spec.js +42 -0
  419. package/esm/memory/logEntriesToString.spec.js.map +1 -0
  420. package/esm/memory/toInspectStringForObject.d.ts +3 -0
  421. package/esm/memory/toInspectStringForObject.d.ts.map +1 -0
  422. package/{libm → esm}/memory/toInspectStringForObject.js +0 -0
  423. package/esm/memory/toInspectStringForObject.js.map +1 -0
  424. package/esm/shouldLog.d.ts +8 -0
  425. package/esm/shouldLog.d.ts.map +1 -0
  426. package/esm/shouldLog.js +10 -0
  427. package/esm/shouldLog.js.map +1 -0
  428. package/esm/store.d.ts +3 -0
  429. package/esm/store.d.ts.map +1 -0
  430. package/esm/store.js +24 -0
  431. package/esm/store.js.map +1 -0
  432. package/esm/suppressLogs.d.ts +6 -0
  433. package/esm/suppressLogs.d.ts.map +1 -0
  434. package/esm/suppressLogs.js +9 -0
  435. package/esm/suppressLogs.js.map +1 -0
  436. package/esm/suppressLogs.spec.d.ts +2 -0
  437. package/esm/suppressLogs.spec.d.ts.map +1 -0
  438. package/esm/suppressLogs.spec.js +29 -0
  439. package/esm/suppressLogs.spec.js.map +1 -0
  440. package/esm/testUtil.d.ts +7 -0
  441. package/esm/testUtil.d.ts.map +1 -0
  442. package/esm/testUtil.js +17 -0
  443. package/esm/testUtil.js.map +1 -0
  444. package/{libm → esm}/types.d.ts +0 -0
  445. package/esm/types.d.ts.map +1 -0
  446. package/{libm → esm}/types.js +0 -0
  447. package/esm/types.js.map +1 -0
  448. package/esm/types.spec.d.ts +2 -0
  449. package/esm/types.spec.d.ts.map +1 -0
  450. package/esm/types.spec.js +5 -0
  451. package/esm/types.spec.js.map +1 -0
  452. package/esm/typesInternal.d.ts +20 -0
  453. package/esm/typesInternal.d.ts.map +1 -0
  454. package/{libm → esm}/typesInternal.js +0 -0
  455. package/esm/typesInternal.js.map +1 -0
  456. package/{libm → esm}/utils.d.ts +0 -0
  457. package/esm/utils.d.ts.map +1 -0
  458. package/esm/utils.js +10 -0
  459. package/esm/utils.js.map +1 -0
  460. package/esm/writeToReporters.d.ts +6 -0
  461. package/esm/writeToReporters.d.ts.map +1 -0
  462. package/esm/writeToReporters.js +18 -0
  463. package/esm/writeToReporters.js.map +1 -0
  464. package/esm/writeToReporters.spec.d.ts +2 -0
  465. package/esm/writeToReporters.spec.d.ts.map +1 -0
  466. package/esm/writeToReporters.spec.js +9 -0
  467. package/esm/writeToReporters.spec.js.map +1 -0
  468. package/package.json +79 -29
  469. package/{src → ts}/LogEntry.ts +0 -0
  470. package/ts/captureLogs.ts +35 -0
  471. package/ts/config.ts +57 -0
  472. package/ts/configForTest.ts +16 -0
  473. package/ts/console/createConsoleLogReporter.ts +42 -0
  474. package/ts/console/index.ts +3 -0
  475. package/ts/console/isConsoleDebugAvailable.ts +11 -0
  476. package/ts/console/polyfilledConsole.ts +34 -0
  477. package/{src → ts}/console/semverGt.ts +0 -0
  478. package/ts/console/toConsoleMethod.ts +18 -0
  479. package/ts/console/types.ts +3 -0
  480. package/ts/customLogLevel.ts +35 -0
  481. package/{src → ts}/errors.ts +0 -0
  482. package/ts/formatter/createTimestampFormatter.ts +21 -0
  483. package/ts/formatter/formatLogLevel.ts +6 -0
  484. package/ts/formatter/index.ts +3 -0
  485. package/ts/formatter/plainLogFormatter.ts +6 -0
  486. package/ts/getDefaultReporter.browser.ts +13 -0
  487. package/ts/getDefaultReporter.ts +15 -0
  488. package/ts/getLogModeFromEnvironment.browser.ts +6 -0
  489. package/ts/getLogModeFromEnvironment.ts +16 -0
  490. package/ts/getLogger.ts +92 -0
  491. package/ts/getLoggers.ts +12 -0
  492. package/ts/index.ts +16 -0
  493. package/{src → ts}/logLevel.ts +0 -0
  494. package/ts/logLevelFn.ts +72 -0
  495. package/ts/logReporter.ts +26 -0
  496. package/ts/logReporterInternal.ts +18 -0
  497. package/ts/memory/MemoryLogReporter.ts +66 -0
  498. package/ts/memory/index.ts +2 -0
  499. package/ts/memory/logEntriesToString.ts +7 -0
  500. package/ts/memory/toInspectStringForObject.ts +13 -0
  501. package/ts/shouldLog.ts +11 -0
  502. package/ts/store.ts +25 -0
  503. package/ts/suppressLogs.ts +14 -0
  504. package/ts/testUtil.ts +19 -0
  505. package/{src → ts}/types.ts +0 -0
  506. package/ts/typesInternal.ts +21 -0
  507. package/ts/utils.ts +9 -0
  508. package/ts/writeToReporters.ts +20 -0
  509. package/CHANGELOG.md +0 -808
  510. package/dist/standard-log.js +0 -5444
  511. package/dist/standard-log.js.gz +0 -0
  512. package/dist/standard-log.js.map +0 -1
  513. package/dist/standard-log.js.map.gz +0 -0
  514. package/lib/LogEntry.d.ts.map +0 -1
  515. package/lib/LogEntry.js.map +0 -1
  516. package/lib/captureLogs.d.ts +0 -4
  517. package/lib/captureLogs.d.ts.map +0 -1
  518. package/lib/captureLogs.js +0 -33
  519. package/lib/captureLogs.js.map +0 -1
  520. package/lib/config.d.ts +0 -12
  521. package/lib/config.d.ts.map +0 -1
  522. package/lib/config.js +0 -49
  523. package/lib/config.js.map +0 -1
  524. package/lib/configForTest.d.ts +0 -5
  525. package/lib/configForTest.d.ts.map +0 -1
  526. package/lib/configForTest.js +0 -18
  527. package/lib/configForTest.js.map +0 -1
  528. package/lib/console/createConsoleLogReporter.d.ts +0 -9
  529. package/lib/console/createConsoleLogReporter.d.ts.map +0 -1
  530. package/lib/console/createConsoleLogReporter.js +0 -42
  531. package/lib/console/createConsoleLogReporter.js.map +0 -1
  532. package/lib/console/index.d.ts +0 -4
  533. package/lib/console/index.d.ts.map +0 -1
  534. package/lib/console/index.js +0 -7
  535. package/lib/console/index.js.map +0 -1
  536. package/lib/console/isConsoleDebugAvailable.d.ts.map +0 -1
  537. package/lib/console/isConsoleDebugAvailable.js +0 -18
  538. package/lib/console/isConsoleDebugAvailable.js.map +0 -1
  539. package/lib/console/polyfilledConsole.d.ts.map +0 -1
  540. package/lib/console/polyfilledConsole.js +0 -41
  541. package/lib/console/polyfilledConsole.js.map +0 -1
  542. package/lib/console/semverGt.d.ts.map +0 -1
  543. package/lib/console/semverGt.js.map +0 -1
  544. package/lib/console/toConsoleMethod.d.ts.map +0 -1
  545. package/lib/console/toConsoleMethod.js +0 -22
  546. package/lib/console/toConsoleMethod.js.map +0 -1
  547. package/lib/console/types.d.ts +0 -3
  548. package/lib/console/types.d.ts.map +0 -1
  549. package/lib/console/types.js.map +0 -1
  550. package/lib/customLogLevel.d.ts +0 -11
  551. package/lib/customLogLevel.d.ts.map +0 -1
  552. package/lib/customLogLevel.js +0 -38
  553. package/lib/customLogLevel.js.map +0 -1
  554. package/lib/errors.d.ts.map +0 -1
  555. package/lib/errors.js +0 -46
  556. package/lib/errors.js.map +0 -1
  557. package/lib/formatter/createTimestampFormatter.d.ts.map +0 -1
  558. package/lib/formatter/createTimestampFormatter.js +0 -24
  559. package/lib/formatter/createTimestampFormatter.js.map +0 -1
  560. package/lib/formatter/formatLogLevel.d.ts.map +0 -1
  561. package/lib/formatter/formatLogLevel.js +0 -10
  562. package/lib/formatter/formatLogLevel.js.map +0 -1
  563. package/lib/formatter/index.d.ts +0 -4
  564. package/lib/formatter/index.d.ts.map +0 -1
  565. package/lib/formatter/index.js +0 -7
  566. package/lib/formatter/index.js.map +0 -1
  567. package/lib/formatter/plainLogFormatter.d.ts +0 -3
  568. package/lib/formatter/plainLogFormatter.d.ts.map +0 -1
  569. package/lib/formatter/plainLogFormatter.js +0 -11
  570. package/lib/formatter/plainLogFormatter.js.map +0 -1
  571. package/lib/getDefaultReporter.browser.d.ts.map +0 -1
  572. package/lib/getDefaultReporter.browser.js +0 -15
  573. package/lib/getDefaultReporter.browser.js.map +0 -1
  574. package/lib/getDefaultReporter.d.ts.map +0 -1
  575. package/lib/getDefaultReporter.js +0 -19
  576. package/lib/getDefaultReporter.js.map +0 -1
  577. package/lib/getLogModeFromEnvironment.browser.d.ts +0 -3
  578. package/lib/getLogModeFromEnvironment.browser.d.ts.map +0 -1
  579. package/lib/getLogModeFromEnvironment.browser.js.map +0 -1
  580. package/lib/getLogModeFromEnvironment.d.ts +0 -3
  581. package/lib/getLogModeFromEnvironment.d.ts.map +0 -1
  582. package/lib/getLogModeFromEnvironment.js +0 -17
  583. package/lib/getLogModeFromEnvironment.js.map +0 -1
  584. package/lib/getLogger.d.ts +0 -9
  585. package/lib/getLogger.d.ts.map +0 -1
  586. package/lib/getLogger.js +0 -95
  587. package/lib/getLogger.js.map +0 -1
  588. package/lib/getLoggers.d.ts +0 -7
  589. package/lib/getLoggers.d.ts.map +0 -1
  590. package/lib/getLoggers.js +0 -15
  591. package/lib/getLoggers.js.map +0 -1
  592. package/lib/index.d.ts +0 -16
  593. package/lib/index.d.ts.map +0 -1
  594. package/lib/index.js +0 -19
  595. package/lib/index.js.map +0 -1
  596. package/lib/logLevel.d.ts.map +0 -1
  597. package/lib/logLevel.js.map +0 -1
  598. package/lib/logLevelFn.d.ts +0 -20
  599. package/lib/logLevelFn.d.ts.map +0 -1
  600. package/lib/logLevelFn.js +0 -76
  601. package/lib/logLevelFn.js.map +0 -1
  602. package/lib/logReporter.d.ts +0 -7
  603. package/lib/logReporter.d.ts.map +0 -1
  604. package/lib/logReporter.js +0 -29
  605. package/lib/logReporter.js.map +0 -1
  606. package/lib/logReporterInternal.d.ts +0 -3
  607. package/lib/logReporterInternal.d.ts.map +0 -1
  608. package/lib/logReporterInternal.js +0 -23
  609. package/lib/logReporterInternal.js.map +0 -1
  610. package/lib/memory/MemoryLogReporter.d.ts +0 -14
  611. package/lib/memory/MemoryLogReporter.d.ts.map +0 -1
  612. package/lib/memory/MemoryLogReporter.js +0 -56
  613. package/lib/memory/MemoryLogReporter.js.map +0 -1
  614. package/lib/memory/index.d.ts +0 -3
  615. package/lib/memory/index.d.ts.map +0 -1
  616. package/lib/memory/index.js +0 -6
  617. package/lib/memory/index.js.map +0 -1
  618. package/lib/memory/logEntriesToString.d.ts +0 -3
  619. package/lib/memory/logEntriesToString.d.ts.map +0 -1
  620. package/lib/memory/logEntriesToString.js +0 -10
  621. package/lib/memory/logEntriesToString.js.map +0 -1
  622. package/lib/memory/toInspectStringForObject.d.ts +0 -3
  623. package/lib/memory/toInspectStringForObject.d.ts.map +0 -1
  624. package/lib/memory/toInspectStringForObject.js +0 -15
  625. package/lib/memory/toInspectStringForObject.js.map +0 -1
  626. package/lib/shouldLog.d.ts +0 -8
  627. package/lib/shouldLog.d.ts.map +0 -1
  628. package/lib/shouldLog.js +0 -14
  629. package/lib/shouldLog.js.map +0 -1
  630. package/lib/store.d.ts +0 -3
  631. package/lib/store.d.ts.map +0 -1
  632. package/lib/store.js +0 -17
  633. package/lib/store.js.map +0 -1
  634. package/lib/testUtil.d.ts +0 -7
  635. package/lib/testUtil.d.ts.map +0 -1
  636. package/lib/testUtil.js +0 -23
  637. package/lib/testUtil.js.map +0 -1
  638. package/lib/types.d.ts.map +0 -1
  639. package/lib/types.js.map +0 -1
  640. package/lib/typesInternal.d.ts +0 -20
  641. package/lib/typesInternal.d.ts.map +0 -1
  642. package/lib/typesInternal.js.map +0 -1
  643. package/lib/utils.d.ts.map +0 -1
  644. package/lib/utils.js +0 -14
  645. package/lib/utils.js.map +0 -1
  646. package/lib/writeToReporters.d.ts +0 -6
  647. package/lib/writeToReporters.d.ts.map +0 -1
  648. package/lib/writeToReporters.js +0 -22
  649. package/lib/writeToReporters.js.map +0 -1
  650. package/libm/LogEntry.d.ts.map +0 -1
  651. package/libm/LogEntry.js.map +0 -1
  652. package/libm/captureLogs.d.ts +0 -4
  653. package/libm/captureLogs.d.ts.map +0 -1
  654. package/libm/captureLogs.js +0 -29
  655. package/libm/captureLogs.js.map +0 -1
  656. package/libm/config.d.ts +0 -12
  657. package/libm/config.d.ts.map +0 -1
  658. package/libm/config.js +0 -44
  659. package/libm/config.js.map +0 -1
  660. package/libm/configForTest.d.ts +0 -5
  661. package/libm/configForTest.d.ts.map +0 -1
  662. package/libm/configForTest.js +0 -14
  663. package/libm/configForTest.js.map +0 -1
  664. package/libm/console/createConsoleLogReporter.d.ts +0 -9
  665. package/libm/console/createConsoleLogReporter.d.ts.map +0 -1
  666. package/libm/console/createConsoleLogReporter.js +0 -37
  667. package/libm/console/createConsoleLogReporter.js.map +0 -1
  668. package/libm/console/index.d.ts +0 -4
  669. package/libm/console/index.d.ts.map +0 -1
  670. package/libm/console/index.js +0 -4
  671. package/libm/console/index.js.map +0 -1
  672. package/libm/console/isConsoleDebugAvailable.d.ts.map +0 -1
  673. package/libm/console/isConsoleDebugAvailable.js +0 -13
  674. package/libm/console/isConsoleDebugAvailable.js.map +0 -1
  675. package/libm/console/polyfilledConsole.d.ts.map +0 -1
  676. package/libm/console/polyfilledConsole.js +0 -32
  677. package/libm/console/polyfilledConsole.js.map +0 -1
  678. package/libm/console/semverGt.d.ts.map +0 -1
  679. package/libm/console/semverGt.js.map +0 -1
  680. package/libm/console/toConsoleMethod.d.ts.map +0 -1
  681. package/libm/console/toConsoleMethod.js +0 -18
  682. package/libm/console/toConsoleMethod.js.map +0 -1
  683. package/libm/console/types.d.ts +0 -3
  684. package/libm/console/types.d.ts.map +0 -1
  685. package/libm/console/types.js.map +0 -1
  686. package/libm/customLogLevel.d.ts +0 -11
  687. package/libm/customLogLevel.d.ts.map +0 -1
  688. package/libm/customLogLevel.js +0 -30
  689. package/libm/customLogLevel.js.map +0 -1
  690. package/libm/errors.d.ts.map +0 -1
  691. package/libm/errors.js +0 -32
  692. package/libm/errors.js.map +0 -1
  693. package/libm/formatter/createTimestampFormatter.d.ts.map +0 -1
  694. package/libm/formatter/createTimestampFormatter.js.map +0 -1
  695. package/libm/formatter/formatLogLevel.d.ts.map +0 -1
  696. package/libm/formatter/formatLogLevel.js +0 -6
  697. package/libm/formatter/formatLogLevel.js.map +0 -1
  698. package/libm/formatter/index.d.ts +0 -4
  699. package/libm/formatter/index.d.ts.map +0 -1
  700. package/libm/formatter/index.js +0 -4
  701. package/libm/formatter/index.js.map +0 -1
  702. package/libm/formatter/plainLogFormatter.d.ts +0 -3
  703. package/libm/formatter/plainLogFormatter.d.ts.map +0 -1
  704. package/libm/formatter/plainLogFormatter.js +0 -5
  705. package/libm/formatter/plainLogFormatter.js.map +0 -1
  706. package/libm/getDefaultReporter.browser.d.ts.map +0 -1
  707. package/libm/getDefaultReporter.browser.js +0 -11
  708. package/libm/getDefaultReporter.browser.js.map +0 -1
  709. package/libm/getDefaultReporter.d.ts.map +0 -1
  710. package/libm/getDefaultReporter.js +0 -15
  711. package/libm/getDefaultReporter.js.map +0 -1
  712. package/libm/getLogModeFromEnvironment.browser.d.ts +0 -3
  713. package/libm/getLogModeFromEnvironment.browser.d.ts.map +0 -1
  714. package/libm/getLogModeFromEnvironment.browser.js.map +0 -1
  715. package/libm/getLogModeFromEnvironment.d.ts +0 -3
  716. package/libm/getLogModeFromEnvironment.d.ts.map +0 -1
  717. package/libm/getLogModeFromEnvironment.js +0 -13
  718. package/libm/getLogModeFromEnvironment.js.map +0 -1
  719. package/libm/getLogger.d.ts +0 -9
  720. package/libm/getLogger.d.ts.map +0 -1
  721. package/libm/getLogger.js +0 -78
  722. package/libm/getLogger.js.map +0 -1
  723. package/libm/getLoggers.d.ts +0 -7
  724. package/libm/getLoggers.d.ts.map +0 -1
  725. package/libm/getLoggers.js +0 -11
  726. package/libm/getLoggers.js.map +0 -1
  727. package/libm/index.d.ts +0 -16
  728. package/libm/index.d.ts.map +0 -1
  729. package/libm/index.js +0 -16
  730. package/libm/index.js.map +0 -1
  731. package/libm/logLevel.d.ts.map +0 -1
  732. package/libm/logLevel.js.map +0 -1
  733. package/libm/logLevelFn.d.ts +0 -20
  734. package/libm/logLevelFn.d.ts.map +0 -1
  735. package/libm/logLevelFn.js +0 -67
  736. package/libm/logLevelFn.js.map +0 -1
  737. package/libm/logReporter.d.ts +0 -7
  738. package/libm/logReporter.d.ts.map +0 -1
  739. package/libm/logReporter.js +0 -21
  740. package/libm/logReporter.js.map +0 -1
  741. package/libm/logReporterInternal.d.ts +0 -3
  742. package/libm/logReporterInternal.d.ts.map +0 -1
  743. package/libm/logReporterInternal.js +0 -19
  744. package/libm/logReporterInternal.js.map +0 -1
  745. package/libm/memory/MemoryLogReporter.d.ts +0 -14
  746. package/libm/memory/MemoryLogReporter.d.ts.map +0 -1
  747. package/libm/memory/MemoryLogReporter.js +0 -51
  748. package/libm/memory/MemoryLogReporter.js.map +0 -1
  749. package/libm/memory/index.d.ts +0 -3
  750. package/libm/memory/index.d.ts.map +0 -1
  751. package/libm/memory/index.js +0 -3
  752. package/libm/memory/index.js.map +0 -1
  753. package/libm/memory/logEntriesToString.d.ts +0 -3
  754. package/libm/memory/logEntriesToString.d.ts.map +0 -1
  755. package/libm/memory/logEntriesToString.js +0 -6
  756. package/libm/memory/logEntriesToString.js.map +0 -1
  757. package/libm/memory/toInspectStringForObject.d.ts +0 -3
  758. package/libm/memory/toInspectStringForObject.d.ts.map +0 -1
  759. package/libm/memory/toInspectStringForObject.js.map +0 -1
  760. package/libm/shouldLog.d.ts +0 -8
  761. package/libm/shouldLog.d.ts.map +0 -1
  762. package/libm/shouldLog.js +0 -10
  763. package/libm/shouldLog.js.map +0 -1
  764. package/libm/store.d.ts +0 -3
  765. package/libm/store.d.ts.map +0 -1
  766. package/libm/store.js +0 -24
  767. package/libm/store.js.map +0 -1
  768. package/libm/testUtil.d.ts +0 -7
  769. package/libm/testUtil.d.ts.map +0 -1
  770. package/libm/testUtil.js +0 -17
  771. package/libm/testUtil.js.map +0 -1
  772. package/libm/types.d.ts.map +0 -1
  773. package/libm/types.js.map +0 -1
  774. package/libm/typesInternal.d.ts +0 -20
  775. package/libm/typesInternal.d.ts.map +0 -1
  776. package/libm/typesInternal.js.map +0 -1
  777. package/libm/utils.d.ts.map +0 -1
  778. package/libm/utils.js +0 -10
  779. package/libm/utils.js.map +0 -1
  780. package/libm/writeToReporters.d.ts +0 -6
  781. package/libm/writeToReporters.d.ts.map +0 -1
  782. package/libm/writeToReporters.js +0 -18
  783. package/libm/writeToReporters.js.map +0 -1
  784. package/src/captureLogs.spec.ts +0 -52
  785. package/src/captureLogs.ts +0 -35
  786. package/src/config.spec.ts +0 -73
  787. package/src/config.ts +0 -57
  788. package/src/configForTest.spec.ts +0 -16
  789. package/src/configForTest.ts +0 -16
  790. package/src/console/createConsoleLogReporter.spec.ts +0 -198
  791. package/src/console/createConsoleLogReporter.ts +0 -42
  792. package/src/console/index.ts +0 -3
  793. package/src/console/isConsoleDebugAvailable.ts +0 -11
  794. package/src/console/polyfilledConsole.ts +0 -34
  795. package/src/console/semverGt.spec.ts +0 -25
  796. package/src/console/toConsoleMethod.ts +0 -18
  797. package/src/console/types.ts +0 -3
  798. package/src/customLogLevel.spec.ts +0 -39
  799. package/src/customLogLevel.ts +0 -35
  800. package/src/formatter/createTimestampFormatter.spec.ts +0 -24
  801. package/src/formatter/createTimestampFormatter.ts +0 -21
  802. package/src/formatter/formatLogLevel.ts +0 -6
  803. package/src/formatter/index.ts +0 -3
  804. package/src/formatter/plainLogFormatter.spec.ts +0 -8
  805. package/src/formatter/plainLogFormatter.ts +0 -6
  806. package/src/getDefaultReporter.browser.ts +0 -13
  807. package/src/getDefaultReporter.ts +0 -15
  808. package/src/getLogModeFromEnvironment.browser.ts +0 -6
  809. package/src/getLogModeFromEnvironment.spec.ts +0 -16
  810. package/src/getLogModeFromEnvironment.ts +0 -16
  811. package/src/getLogger.spec.ts +0 -460
  812. package/src/getLogger.ts +0 -92
  813. package/src/getLoggers.ts +0 -12
  814. package/src/index.ts +0 -15
  815. package/src/logLevel.spec.ts +0 -161
  816. package/src/logLevelFn.ts +0 -72
  817. package/src/logReporter.spec.ts +0 -99
  818. package/src/logReporter.ts +0 -26
  819. package/src/logReporterInternal.ts +0 -18
  820. package/src/memory/MemoryLogReporter.spec.ts +0 -114
  821. package/src/memory/MemoryLogReporter.ts +0 -66
  822. package/src/memory/index.ts +0 -2
  823. package/src/memory/logEntriesToString.spec.ts +0 -47
  824. package/src/memory/logEntriesToString.ts +0 -7
  825. package/src/memory/toInspectStringForObject.ts +0 -13
  826. package/src/shouldLog.ts +0 -11
  827. package/src/store.ts +0 -25
  828. package/src/testUtil.ts +0 -19
  829. package/src/types.spec.ts +0 -7
  830. package/src/typesInternal.ts +0 -21
  831. package/src/utils.ts +0 -9
  832. package/src/writeToReporters.spec.ts +0 -9
  833. package/src/writeToReporters.ts +0 -20
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var assertron_1 = __importDefault(require("assertron"));
7
+ var index_js_1 = require("../index.js");
8
+ var store_js_1 = require("../store.js");
9
+ describe('production checks', function () {
10
+ beforeEach(function () { return store_js_1.store.reset(); });
11
+ test('set filter during production mode throws', function () {
12
+ (0, index_js_1.config)({ mode: 'production' });
13
+ var reporter = (0, index_js_1.createConsoleLogReporter)();
14
+ assertron_1.default.throws(function () { reporter.filter = function () { return true; }; }, index_js_1.ProhibitedDuringProduction);
15
+ });
16
+ var idFormatter = function (entry) { return [entry.id]; };
17
+ test('set formatter during production mode throws', function () {
18
+ (0, index_js_1.config)({ mode: 'production' });
19
+ var reporter = (0, index_js_1.createConsoleLogReporter)();
20
+ assertron_1.default.throws(function () { return reporter.formatter = idFormatter; }, index_js_1.ProhibitedDuringProduction);
21
+ });
22
+ });
23
+ describe('unit tests', function () {
24
+ beforeEach(function () { return (0, index_js_1.configForTest)(); });
25
+ describe('rendering tests', function () {
26
+ test('plain rendering', function () {
27
+ var reporter = (0, index_js_1.createConsoleLogReporter)({ formatter: index_js_1.plainLogFormatter });
28
+ ['emergency', 'info', 'warn', 'debug'].forEach(function (level) {
29
+ reporter.write({ id: 'plain', level: index_js_1.logLevels[level], args: ['hello', 'world'], timestamp: new Date() });
30
+ });
31
+ });
32
+ });
33
+ describe('id', function () {
34
+ test('default is "console"', function () {
35
+ var reporter = (0, index_js_1.createConsoleLogReporter)();
36
+ expect(reporter.id).toBe('console');
37
+ });
38
+ test('can be overridden', function () {
39
+ var reporter = (0, index_js_1.createConsoleLogReporter)({ id: 'neo-console' });
40
+ expect(reporter.id).toBe('neo-console');
41
+ });
42
+ });
43
+ describe('log level', function () {
44
+ test('error, alert, critical and emergency logs are written to console.error', function () {
45
+ var id = 'log';
46
+ var reporter = (0, index_js_1.createConsoleLogReporter)();
47
+ var fakeConsole = reporter.console = createFakeConsole();
48
+ reporter.write({ id: id, level: index_js_1.logLevels.emergency, args: ['emergency'], timestamp: new Date() });
49
+ reporter.write({ id: id, level: index_js_1.logLevels.critical, args: ['critical'], timestamp: new Date() });
50
+ reporter.write({ id: id, level: index_js_1.logLevels.alert, args: ['alert'], timestamp: new Date() });
51
+ reporter.write({ id: id, level: index_js_1.logLevels.error, args: ['error'], timestamp: new Date() });
52
+ expect(fakeConsole.errors.length).toBe(4);
53
+ });
54
+ test('warn logs are written to console.warn', function () {
55
+ var id = 'log';
56
+ var reporter = (0, index_js_1.createConsoleLogReporter)();
57
+ var fakeConsole = reporter.console = createFakeConsole();
58
+ reporter.write({ id: id, level: index_js_1.logLevels.warn, args: ['warn'], timestamp: new Date() });
59
+ expect(fakeConsole.warns.length).toBe(1);
60
+ });
61
+ test('notice and info logs are written to console.info', function () {
62
+ var id = 'log';
63
+ var reporter = (0, index_js_1.createConsoleLogReporter)();
64
+ var fakeConsole = reporter.console = createFakeConsole();
65
+ reporter.write({ id: id, level: index_js_1.logLevels.notice, args: ['notice'], timestamp: new Date() });
66
+ reporter.write({ id: id, level: index_js_1.logLevels.info, args: ['info'], timestamp: new Date() });
67
+ expect(fakeConsole.infos.length).toBe(2);
68
+ });
69
+ test('debug, trace, and planck logs are written to console.debug', function () {
70
+ var id = 'log';
71
+ var reporter = (0, index_js_1.createConsoleLogReporter)();
72
+ var fakeConsole = reporter.console = createFakeConsole();
73
+ reporter.write({ id: id, level: index_js_1.logLevels.debug, args: ['debug'], timestamp: new Date() });
74
+ reporter.write({ id: id, level: index_js_1.logLevels.trace, args: ['trace'], timestamp: new Date() });
75
+ reporter.write({ id: id, level: index_js_1.logLevels.planck, args: ['planck'], timestamp: new Date() });
76
+ expect(fakeConsole.debugs.length).toBe(3);
77
+ });
78
+ });
79
+ describe('custom logs', function () {
80
+ afterEach(function () { return (0, index_js_1.clearCustomLogLevel)(); });
81
+ test('are written according to their log level value', function () {
82
+ (0, index_js_1.addCustomLogLevel)('high', 50);
83
+ (0, index_js_1.addCustomLogLevel)('important', 450);
84
+ (0, index_js_1.addCustomLogLevel)('interest', 650);
85
+ (0, index_js_1.addCustomLogLevel)('silly', 1000);
86
+ var id = 'log';
87
+ var reporter = (0, index_js_1.createConsoleLogReporter)();
88
+ var fakeConsole = reporter.console = createFakeConsole();
89
+ reporter.write({ id: id, level: 50, args: ['a'], timestamp: new Date() });
90
+ reporter.write({ id: id, level: 450, args: ['b'], timestamp: new Date() });
91
+ reporter.write({ id: id, level: 650, args: ['c'], timestamp: new Date() });
92
+ reporter.write({ id: id, level: 1000, args: ['d'], timestamp: new Date() });
93
+ expect(fakeConsole.errors.length).toBe(1);
94
+ expect(fakeConsole.warns.length).toBe(1);
95
+ expect(fakeConsole.infos.length).toBe(1);
96
+ expect(fakeConsole.debugs.length).toBe(1);
97
+ });
98
+ });
99
+ var idFormatter = function (entry) { return [entry.id]; };
100
+ describe('formatter', function () {
101
+ test('use specific formatter', function () {
102
+ var id = 'id-only';
103
+ var reporter = (0, index_js_1.createConsoleLogReporter)({ formatter: idFormatter });
104
+ var fakeConsole = reporter.console = createFakeConsole();
105
+ reporter.write({ id: id, level: index_js_1.logLevels.emergency, args: ['emergency'], timestamp: new Date() });
106
+ expect(fakeConsole.errors).toEqual([['id-only']]);
107
+ });
108
+ test('formatter can be changed afterward', function () {
109
+ var reporter = (0, index_js_1.createConsoleLogReporter)();
110
+ var formatter = reporter.formatter;
111
+ reporter.formatter = idFormatter;
112
+ expect(reporter.formatter).not.toEqual(formatter);
113
+ });
114
+ });
115
+ describe('filter', function () {
116
+ var filter = function (entry) { return entry.id !== 'secret'; };
117
+ test('use specific filter', function () {
118
+ var reporter = (0, index_js_1.createConsoleLogReporter)({ formatter: idFormatter, filter: filter });
119
+ var fakeConsole = reporter.console = createFakeConsole();
120
+ reporter.write({ id: 'normal', level: index_js_1.logLevels.emergency, args: ['emergency'], timestamp: new Date() });
121
+ reporter.write({ id: 'secret', level: index_js_1.logLevels.emergency, args: ['emergency'], timestamp: new Date() });
122
+ expect(fakeConsole.errors).toEqual([['normal']]);
123
+ });
124
+ test('can change filter', function () {
125
+ var reporter = (0, index_js_1.createConsoleLogReporter)();
126
+ var filter = reporter.filter;
127
+ reporter.filter = function (entry) { return entry.id !== 'secret'; };
128
+ expect(reporter.filter).not.toEqual(filter);
129
+ });
130
+ });
131
+ test('write log entry with multiple arguments', function () {
132
+ var id = 'log';
133
+ var reporter = (0, index_js_1.createConsoleLogReporter)({ formatter: index_js_1.plainLogFormatter });
134
+ var fakeConsole = reporter.console = createFakeConsole();
135
+ var entry = { id: id, level: index_js_1.logLevels.info, args: ['a', 'b', 'c'], timestamp: new Date() };
136
+ reporter.write(entry);
137
+ expect(fakeConsole.infos).toEqual([
138
+ [entry.timestamp.toISOString(), 'log', '(INFO)', 'a', 'b', 'c']
139
+ ]);
140
+ });
141
+ });
142
+ function createFakeConsole() {
143
+ var errors = [];
144
+ var infos = [];
145
+ var warns = [];
146
+ var debugs = [];
147
+ return {
148
+ errors: errors,
149
+ infos: infos,
150
+ warns: warns,
151
+ debugs: debugs,
152
+ error: function () {
153
+ var args = [];
154
+ for (var _i = 0; _i < arguments.length; _i++) {
155
+ args[_i] = arguments[_i];
156
+ }
157
+ errors.push(args);
158
+ },
159
+ info: function () {
160
+ var args = [];
161
+ for (var _i = 0; _i < arguments.length; _i++) {
162
+ args[_i] = arguments[_i];
163
+ }
164
+ infos.push(args);
165
+ },
166
+ warn: function () {
167
+ var args = [];
168
+ for (var _i = 0; _i < arguments.length; _i++) {
169
+ args[_i] = arguments[_i];
170
+ }
171
+ warns.push(args);
172
+ },
173
+ debug: function () {
174
+ var args = [];
175
+ for (var _i = 0; _i < arguments.length; _i++) {
176
+ args[_i] = arguments[_i];
177
+ }
178
+ debugs.push(args);
179
+ }
180
+ };
181
+ }
182
+ //# sourceMappingURL=createConsoleLogReporter.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createConsoleLogReporter.spec.js","sourceRoot":"","sources":["../../ts/console/createConsoleLogReporter.spec.ts"],"names":[],"mappings":";;;;;AAAA,wDAAyB;AACzB,wCAIoB;AACpB,wCAAmC;AAEnC,QAAQ,CAAC,mBAAmB,EAAE;IAC5B,UAAU,CAAC,cAAM,OAAA,gBAAK,CAAC,KAAK,EAAE,EAAb,CAAa,CAAC,CAAA;IAE/B,IAAI,CAAC,0CAA0C,EAAE;QAC/C,IAAA,iBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAA;QAC9B,IAAM,QAAQ,GAAG,IAAA,mCAAwB,GAAE,CAAA;QAC3C,mBAAC,CAAC,MAAM,CAAC,cAAQ,QAAQ,CAAC,MAAM,GAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAA,CAAC,CAAC,EAAE,qCAA0B,CAAC,CAAA;IAC9E,CAAC,CAAC,CAAA;IAEF,IAAM,WAAW,GAAwB,UAAC,KAAK,IAAK,OAAA,CAAC,KAAK,CAAC,EAAE,CAAC,EAAV,CAAU,CAAA;IAC9D,IAAI,CAAC,6CAA6C,EAAE;QAClD,IAAA,iBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAA;QAC9B,IAAM,QAAQ,GAAG,IAAA,mCAAwB,GAAE,CAAA;QAC3C,mBAAC,CAAC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AAC,OAAO,CAAC;YAChC,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;SAChE,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAGF,SAAS,iBAAiB;IACxB,IAAM,MAAM,GAAU,EAAE,CAAA;IACxB,IAAM,KAAK,GAAU,EAAE,CAAA;IACvB,IAAM,KAAK,GAAU,EAAE,CAAA;IACvB,IAAM,MAAM,GAAU,EAAE,CAAA;IACxB,OAAO;QACL,MAAM,QAAA;QACN,KAAK,OAAA;QACL,KAAK,OAAA;QACL,MAAM,QAAA;QACN,KAAK,EAAL;YAAM,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAAC,CAAC;QAC3C,IAAI,EAAJ;YAAK,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAAC,CAAC;QACzC,IAAI,EAAJ;YAAK,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAAC,CAAC;QACzC,KAAK,EAAL;YAAM,cAAc;iBAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;gBAAd,yBAAc;;YAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAAC,CAAC;KAC5C,CAAA;AACH,CAAC","sourcesContent":["import a from 'assertron'\nimport {\n addCustomLogLevel, clearCustomLogLevel, config, configForTest,\n ConsoleLogFormatter, createConsoleLogReporter,\n LogFilter, logLevels, plainLogFormatter, ProhibitedDuringProduction\n} from '../index.js'\nimport { store } from '../store.js'\n\ndescribe('production checks', () => {\n beforeEach(() => store.reset())\n\n test('set filter during production mode throws', () => {\n config({ mode: 'production' })\n const reporter = createConsoleLogReporter()\n a.throws(() => { reporter.filter = () => true }, ProhibitedDuringProduction)\n })\n\n const idFormatter: ConsoleLogFormatter = (entry) => [entry.id]\n test('set formatter during production mode throws', () => {\n config({ mode: 'production' })\n const reporter = createConsoleLogReporter()\n a.throws(() => reporter.formatter = idFormatter, ProhibitedDuringProduction)\n })\n})\n\n\ndescribe('unit tests', () => {\n beforeEach(() => configForTest())\n\n describe('rendering tests', () => {\n test('plain rendering', () => {\n const reporter = createConsoleLogReporter({ formatter: plainLogFormatter });\n ['emergency', 'info', 'warn', 'debug'].forEach(level => {\n reporter.write({ id: 'plain', level: (logLevels as any)[level], args: ['hello', 'world'], timestamp: new Date() })\n })\n })\n })\n\n describe('id', () => {\n test('default is \"console\"', () => {\n const reporter = createConsoleLogReporter()\n expect(reporter.id).toBe('console')\n })\n test('can be overridden', () => {\n const reporter = createConsoleLogReporter({ id: 'neo-console' })\n expect(reporter.id).toBe('neo-console')\n })\n })\n\n describe('log level', () => {\n test('error, alert, critical and emergency logs are written to console.error', () => {\n const id = 'log'\n const reporter = createConsoleLogReporter()\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id, level: logLevels.emergency, args: ['emergency'], timestamp: new Date() })\n reporter.write({ id, level: logLevels.critical, args: ['critical'], timestamp: new Date() })\n reporter.write({ id, level: logLevels.alert, args: ['alert'], timestamp: new Date() })\n reporter.write({ id, level: logLevels.error, args: ['error'], timestamp: new Date() })\n\n expect(fakeConsole.errors.length).toBe(4)\n })\n\n test('warn logs are written to console.warn', () => {\n const id = 'log'\n const reporter = createConsoleLogReporter()\n\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id, level: logLevels.warn, args: ['warn'], timestamp: new Date() })\n\n expect(fakeConsole.warns.length).toBe(1)\n })\n\n test('notice and info logs are written to console.info', () => {\n const id = 'log'\n const reporter = createConsoleLogReporter()\n\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id, level: logLevels.notice, args: ['notice'], timestamp: new Date() })\n reporter.write({ id, level: logLevels.info, args: ['info'], timestamp: new Date() })\n\n expect(fakeConsole.infos.length).toBe(2)\n })\n\n\n test('debug, trace, and planck logs are written to console.debug', () => {\n const id = 'log'\n const reporter = createConsoleLogReporter()\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id, level: logLevels.debug, args: ['debug'], timestamp: new Date() })\n reporter.write({ id, level: logLevels.trace, args: ['trace'], timestamp: new Date() })\n reporter.write({ id, level: logLevels.planck, args: ['planck'], timestamp: new Date() })\n\n expect(fakeConsole.debugs.length).toBe(3)\n })\n })\n\n describe('custom logs', () => {\n afterEach(() => clearCustomLogLevel())\n\n test('are written according to their log level value', () => {\n addCustomLogLevel('high', 50)\n addCustomLogLevel('important', 450)\n addCustomLogLevel('interest', 650)\n addCustomLogLevel('silly', 1000)\n\n const id = 'log'\n const reporter = createConsoleLogReporter()\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id, level: 50, args: ['a'], timestamp: new Date() })\n reporter.write({ id, level: 450, args: ['b'], timestamp: new Date() })\n reporter.write({ id, level: 650, args: ['c'], timestamp: new Date() })\n reporter.write({ id, level: 1000, args: ['d'], timestamp: new Date() })\n\n expect(fakeConsole.errors.length).toBe(1)\n expect(fakeConsole.warns.length).toBe(1)\n expect(fakeConsole.infos.length).toBe(1)\n expect(fakeConsole.debugs.length).toBe(1)\n })\n })\n\n const idFormatter: ConsoleLogFormatter = (entry) => [entry.id]\n\n describe('formatter', () => {\n test('use specific formatter', () => {\n const id = 'id-only'\n const reporter = createConsoleLogReporter({ formatter: idFormatter })\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id, level: logLevels.emergency, args: ['emergency'], timestamp: new Date() })\n\n expect(fakeConsole.errors).toEqual([['id-only']])\n })\n\n test('formatter can be changed afterward', () => {\n const reporter = createConsoleLogReporter()\n const formatter = reporter.formatter\n reporter.formatter = idFormatter\n expect(reporter.formatter).not.toEqual(formatter)\n })\n })\n\n describe('filter', () => {\n const filter: LogFilter = (entry) => entry.id !== 'secret'\n test('use specific filter', () => {\n const reporter = createConsoleLogReporter({ formatter: idFormatter, filter })\n const fakeConsole = reporter.console = createFakeConsole()\n\n reporter.write({ id: 'normal', level: logLevels.emergency, args: ['emergency'], timestamp: new Date() })\n reporter.write({ id: 'secret', level: logLevels.emergency, args: ['emergency'], timestamp: new Date() })\n\n expect(fakeConsole.errors).toEqual([['normal']])\n })\n\n test('can change filter', () => {\n const reporter = createConsoleLogReporter()\n const filter = reporter.filter\n reporter.filter = entry => entry.id !== 'secret'\n expect(reporter.filter).not.toEqual(filter)\n })\n })\n\n test('write log entry with multiple arguments', () => {\n const id = 'log'\n const reporter = createConsoleLogReporter({ formatter: plainLogFormatter })\n const fakeConsole = reporter.console = createFakeConsole()\n\n const entry = { id, level: logLevels.info, args: ['a', 'b', 'c'], timestamp: new Date() }\n\n reporter.write(entry)\n\n expect(fakeConsole.infos).toEqual([\n [entry.timestamp.toISOString(), 'log', '(INFO)', 'a', 'b', 'c']\n ])\n })\n})\n\n\nfunction createFakeConsole() {\n const errors: any[] = []\n const infos: any[] = []\n const warns: any[] = []\n const debugs: any[] = []\n return {\n errors,\n infos,\n warns,\n debugs,\n error(...args: any[]) { errors.push(args) },\n info(...args: any[]) { infos.push(args) },\n warn(...args: any[]) { warns.push(args) },\n debug(...args: any[]) { debugs.push(args) }\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export * from './createConsoleLogReporter.js';
2
+ export * from './toConsoleMethod.js';
3
+ export * from './types.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/console/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./createConsoleLogReporter.js"), exports);
18
+ __exportStar(require("./toConsoleMethod.js"), exports);
19
+ __exportStar(require("./types.js"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/console/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA6C;AAC7C,uDAAoC;AACpC,6CAA0B","sourcesContent":["export * from './createConsoleLogReporter.js'\nexport * from './toConsoleMethod.js'\nexport * from './types.js'\n"]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isConsoleDebugAvailable.d.ts","sourceRoot":"","sources":["../../ts/console/isConsoleDebugAvailable.ts"],"names":[],"mappings":"AAIA,wBAAgB,uBAAuB,YAMtC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isConsoleDebugAvailable = void 0;
7
+ var is_node_1 = __importDefault(require("is-node"));
8
+ var semverGt_js_1 = require("./semverGt.js");
9
+ // istanbul ignore file
10
+ function isConsoleDebugAvailable() {
11
+ if (!is_node_1.default)
12
+ return true;
13
+ // without this, systemJs will complain `process is not defined`
14
+ if (!global.process)
15
+ return true;
16
+ var versionString = process.version.startsWith('v') ? process.version.slice(1) : process.version;
17
+ return (0, semverGt_js_1.semverGt)(versionString, [9, 3, 0]);
18
+ }
19
+ exports.isConsoleDebugAvailable = isConsoleDebugAvailable;
20
+ //# sourceMappingURL=isConsoleDebugAvailable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isConsoleDebugAvailable.js","sourceRoot":"","sources":["../../ts/console/isConsoleDebugAvailable.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,6CAAwC;AAExC,uBAAuB;AACvB,SAAgB,uBAAuB;IACrC,IAAI,CAAC,iBAAM;QAAE,OAAO,IAAI,CAAA;IACxB,gEAAgE;IAChE,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAChC,IAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;IAClG,OAAO,IAAA,sBAAQ,EAAC,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAC3C,CAAC;AAND,0DAMC","sourcesContent":["import isNode from 'is-node'\nimport { semverGt } from './semverGt.js'\n\n// istanbul ignore file\nexport function isConsoleDebugAvailable() {\n if (!isNode) return true\n // without this, systemJs will complain `process is not defined`\n if (!global.process) return true\n const versionString = process.version.startsWith('v') ? process.version.slice(1) : process.version\n return semverGt(versionString, [9, 3, 0])\n}\n"]}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyfilledConsole.d.ts","sourceRoot":"","sources":["../../ts/console/polyfilledConsole.ts"],"names":[],"mappings":"AAiCA,eAAO,MAAM,iBAAiB;;;;;CAAyB,CAAA"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.polyfilledConsole = void 0;
4
+ /* istanbul ignore file */
5
+ var isConsoleDebugAvailable_js_1 = require("./isConsoleDebugAvailable.js");
6
+ /* eslint-disable no-console */
7
+ function buildPolyfillConsole() {
8
+ // old phantomjs does not have bind function
9
+ var hasBind = !!console.log.bind;
10
+ if (hasBind) {
11
+ return {
12
+ // Node@9.3 or below has `console.debug = undefined` or it doesn't log
13
+ // Should use `console.log()` in those case.
14
+ debug: ((0, isConsoleDebugAvailable_js_1.isConsoleDebugAvailable)() ? console.debug : console.log).bind(console),
15
+ // the `typeof` guards against IE where `console.log.apply()`
16
+ // results in error `Object doesn't support property or method 'apply'`
17
+ info: (typeof console.info === 'function' ? console.info : console.log).bind(console),
18
+ warn: (typeof console.warn === 'function' ? console.warn : console.log).bind(console),
19
+ error: (typeof console.error === 'function' ? console.error : console.log).bind(console)
20
+ };
21
+ }
22
+ else {
23
+ return {
24
+ debug: buildFn((0, isConsoleDebugAvailable_js_1.isConsoleDebugAvailable)() ? 'debug' : 'log'),
25
+ info: buildFn(typeof console.info === 'function' ? 'info' : 'log'),
26
+ warn: buildFn(typeof console.warn === 'function' ? 'warn' : 'log'),
27
+ error: buildFn(typeof console.error === 'function' ? 'error' : 'log'),
28
+ };
29
+ }
30
+ }
31
+ function buildFn(name) {
32
+ return function () {
33
+ var args = [];
34
+ for (var _i = 0; _i < arguments.length; _i++) {
35
+ args[_i] = arguments[_i];
36
+ }
37
+ console[name].apply(console, args);
38
+ };
39
+ }
40
+ exports.polyfilledConsole = buildPolyfillConsole();
41
+ //# sourceMappingURL=polyfilledConsole.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyfilledConsole.js","sourceRoot":"","sources":["../../ts/console/polyfilledConsole.ts"],"names":[],"mappings":";;;AAAA,0BAA0B;AAC1B,2EAAsE;AACtE,+BAA+B;AAE/B,SAAS,oBAAoB;IAC3B,4C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AO,CAAC,OAAO,OAAO,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;SACtE,CAAA;KACF;AACH,CAAC;AAED,SAAS,OAAO,CAAC,IAAiD;IAChE,OAAO;QAAU,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,yBAAc;;QAAI,OAAO,CAAC,IAAI,CAAC,OAAb,OAAO,EAAU,IAAI,EAAC;IAAC,CAAC,CAAA;AAC7D,CAAC;AAEY,QAAA,iBAAiB,GAAG,oBAAoB,EAAE,CAAA","sourcesContent":["/* istanbul ignore file */\nimport { isConsoleDebugAvailable } from './isConsoleDebugAvailable.js'\n/* eslint-disable no-console */\n\nfunction buildPolyfillConsole() {\n // old phantomjs does not have bind function\n const hasBind = !!console.log.bind as boolean\n if (hasBind) {\n return {\n // Node@9.3 or below has `console.debug = undefined` or it doesn't log\n // Should use `console.log()` in those case.\n debug: (isConsoleDebugAvailable() ? console.debug : console.log).bind(console),\n // the `typeof` guards against IE where `console.log.apply()`\n // results in error `Object doesn't support property or method 'apply'`\n info: (typeof console.info === 'function' ? console.info : console.log).bind(console),\n warn: (typeof console.warn === 'function' ? console.warn : console.log).bind(console),\n error: (typeof console.error === 'function' ? console.error : console.log).bind(console)\n }\n }\n else {\n return {\n debug: buildFn(isConsoleDebugAvailable() ? 'debug' : 'log'),\n info: buildFn(typeof console.info === 'function' ? 'info' : 'log'),\n warn: buildFn(typeof console.warn === 'function' ? 'warn' : 'log'),\n error: buildFn(typeof console.error === 'function' ? 'error' : 'log'),\n }\n }\n}\n\nfunction buildFn(name: 'debug' | 'info' | 'warn' | 'error' | 'log') {\n return function (...args: any[]) { console[name](...args) }\n}\n\nexport const polyfilledConsole = buildPolyfillConsole()\n"]}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semverGt.d.ts","sourceRoot":"","sources":["../../ts/console/semverGt.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,WAOhF"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semverGt.js","sourceRoot":"","sources":["../../ts/console/semverGt.ts"],"names":[],"mappings":";;;AAAA,uBAAuB;AACvB,SAAgB,QAAQ,CAAC,aAAqB,EAAE,OAAiC;IAC/E,IAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,UAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC/D,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;QAC9C,OAAO,CAAC,CAAA;IACV,CAAC,EAAE,CAAC,CAAC,CAAA;IAEL,OAAO,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AACtE,CAAC;AAPD,4BAOC","sourcesContent":["// istanbul ignore next\nexport function semverGt(versionString: string, version: [number, number, number]) {\n const actual = versionString.split('.').reverse().reduce((p, v, i) => {\n p += Number.parseInt(v, 10) * Math.pow(100, i)\n return p\n }, 0)\n\n return actual > (version[0] * 10000 + version[1] * 100 + version[2])\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=semverGt.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semverGt.spec.d.ts","sourceRoot":"","sources":["../../ts/console/semverGt.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var semverGt_js_1 = require("./semverGt.js");
4
+ test('9.3.0 returns false', function () {
5
+ expect((0, semverGt_js_1.semverGt)('9.3.0', [9, 3, 0])).toBe(false);
6
+ });
7
+ test('9.3.1 returns true', function () {
8
+ expect((0, semverGt_js_1.semverGt)('9.3.1', [9, 3, 0])).toBe(true);
9
+ });
10
+ test('9.3.1 returns true', function () {
11
+ expect((0, semverGt_js_1.semverGt)('9.3.1', [9, 3, 0])).toBe(true);
12
+ });
13
+ test('9.4.0 returns true', function () {
14
+ expect((0, semverGt_js_1.semverGt)('9.4.0', [9, 3, 0])).toBe(true);
15
+ });
16
+ test('9.10.0 returns true', function () {
17
+ expect((0, semverGt_js_1.semverGt)('9.10.0', [9, 3, 0])).toBe(true);
18
+ });
19
+ test('10.0.0 returns true', function () {
20
+ expect((0, semverGt_js_1.semverGt)('10.0.0', [9, 3, 0])).toBe(true);
21
+ });
22
+ //# sourceMappingURL=semverGt.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semverGt.spec.js","sourceRoot":"","sources":["../../ts/console/semverGt.spec.ts"],"names":[],"mappings":";;AAAA,6CAAwC;AAExC,IAAI,CAAC,qBAAqB,EAAE;IAC1B,MAAM,CAAC,IAAA,sBAAQ,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,oBAAoB,EAAE;IACzB,MAAM,CAAC,IAAA,sBAAQ,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACjD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,oBAAoB,EAAE;IACzB,MAAM,CAAC,IAAA,sBAAQ,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACjD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,oBAAoB,EAAE;IACzB,MAAM,CAAC,IAAA,sBAAQ,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACjD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,qBAAqB,EAAE;IAC1B,MAAM,CAAC,IAAA,sBAAQ,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,qBAAqB,EAAE;IAC1B,MAAM,CAAC,IAAA,sBAAQ,EAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA","sourcesContent":["import { semverGt } from './semverGt.js'\n\ntest('9.3.0 returns false', () => {\n expect(semverGt('9.3.0', [9, 3, 0])).toBe(false)\n})\n\ntest('9.3.1 returns true', () => {\n expect(semverGt('9.3.1', [9, 3, 0])).toBe(true)\n})\n\ntest('9.3.1 returns true', () => {\n expect(semverGt('9.3.1', [9, 3, 0])).toBe(true)\n})\n\ntest('9.4.0 returns true', () => {\n expect(semverGt('9.4.0', [9, 3, 0])).toBe(true)\n})\n\ntest('9.10.0 returns true', () => {\n expect(semverGt('9.10.0', [9, 3, 0])).toBe(true)\n})\n\ntest('10.0.0 returns true', () => {\n expect(semverGt('10.0.0', [9, 3, 0])).toBe(true)\n})\n"]}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toConsoleMethod.d.ts","sourceRoot":"","sources":["../../ts/console/toConsoleMethod.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,uCAe5C"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toConsoleMethod = void 0;
4
+ var logLevel_js_1 = require("../logLevel.js");
5
+ function toConsoleMethod(level) {
6
+ switch (true) {
7
+ // istanbul ignore next
8
+ case (level === 0):
9
+ // edge case in case none is somehow written
10
+ return 'debug';
11
+ case (level <= logLevel_js_1.logLevels.error):
12
+ return 'error';
13
+ case (level <= logLevel_js_1.logLevels.warn):
14
+ return 'warn';
15
+ case (level <= logLevel_js_1.logLevels.info):
16
+ return 'info';
17
+ default:
18
+ return 'debug';
19
+ }
20
+ }
21
+ exports.toConsoleMethod = toConsoleMethod;
22
+ //# sourceMappingURL=toConsoleMethod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toConsoleMethod.js","sourceRoot":"","sources":["../../ts/console/toConsoleMethod.ts"],"names":[],"mappings":";;;AAAA,8CAA0C;AAE1C,SAAgB,eAAe,CAAC,KAAa;IAC3C,QAAQ,IAAI,EAAE;QACZ,uBAAuB;QACvB,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC;YAChB,4CAA4C;YAC5C,OAAO,OAAO,CAAA;QAChB,KAAK,CAAC,KAAK,IAAI,uBAAS,CAAC,KAAK,CAAC;YAC7B,OAAO,OAAO,CAAA;QAChB,KAAK,CAAC,KAAK,IAAI,uBAAS,CAAC,IAAI,CAAC;YAC5B,OAAO,MAAM,CAAA;QACf,KAAK,CAAC,KAAK,IAAI,uBAAS,CAAC,IAAI,CAAC;YAC5B,OAAO,MAAM,CAAA;QACf;YACE,OAAO,OAAO,CAAA;KACjB;AACH,CAAC;AAfD,0CAeC","sourcesContent":["import { logLevels } from '../logLevel.js'\n\nexport function toConsoleMethod(level: number) {\n switch (true) {\n // istanbul ignore next\n case (level === 0):\n // edge case in case none is somehow written\n return 'debug'\n case (level <= logLevels.error):\n return 'error'\n case (level <= logLevels.warn):\n return 'warn'\n case (level <= logLevels.info):\n return 'info'\n default:\n return 'debug'\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { polyfilledConsole } from './polyfilledConsole.js';
2
+ export declare type Console = typeof polyfilledConsole;
3
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../ts/console/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE1D,oBAAY,OAAO,GAAG,OAAO,iBAAiB,CAAA"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../ts/console/types.ts"],"names":[],"mappings":"","sourcesContent":["import { polyfilledConsole } from './polyfilledConsole.js'\n\nexport type Console = typeof polyfilledConsole\n"]}
@@ -0,0 +1,11 @@
1
+ import { LogLevelEntry } from './types.js';
2
+ /**
3
+ * @param level the `logLevel` number.
4
+ * You can specify this in the form of `logLevel.<x> + n` to make it more readable.
5
+ */
6
+ export declare function addCustomLogLevel(name: string, level: number): void;
7
+ export declare function clearCustomLogLevel(): void;
8
+ export declare function getCustomLevel(name: string): number | undefined;
9
+ export declare function getCustomLevelName(level: number): string | undefined;
10
+ export declare function getCustomLevels(): LogLevelEntry[];
11
+ //# sourceMappingURL=customLogLevel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customLogLevel.d.ts","sourceRoot":"","sources":["../ts/customLogLevel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAM5D;AAED,wBAAgB,mBAAmB,SAKlC;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE/D;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEpE;AAED,wBAAgB,eAAe,IAAI,aAAa,EAAE,CAGjD"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCustomLevels = exports.getCustomLevelName = exports.getCustomLevel = exports.clearCustomLogLevel = exports.addCustomLogLevel = void 0;
4
+ var type_plus_1 = require("type-plus");
5
+ var store_js_1 = require("./store.js");
6
+ /**
7
+ * @param level the `logLevel` number.
8
+ * You can specify this in the form of `logLevel.<x> + n` to make it more readable.
9
+ */
10
+ function addCustomLogLevel(name, level) {
11
+ var _a = store_js_1.store.value, customLevels = _a.customLevels, customLevelsReverse = _a.customLevelsReverse;
12
+ customLevels[name] = level;
13
+ customLevelsReverse[level] = name;
14
+ var loggerClosures = store_js_1.store.value.loggerClosures;
15
+ (0, type_plus_1.forEachKey)(loggerClosures, function (id) { return loggerClosures[id].addMethod(name, level); });
16
+ }
17
+ exports.addCustomLogLevel = addCustomLogLevel;
18
+ function clearCustomLogLevel() {
19
+ var _a = store_js_1.store.value, customLevels = _a.customLevels, customLevelsReverse = _a.customLevelsReverse;
20
+ // Don't replace the object would prevent reference divergence
21
+ (0, type_plus_1.forEachKey)(customLevels, function (k) { return delete customLevels[k]; });
22
+ customLevelsReverse.splice(0, customLevelsReverse.length);
23
+ }
24
+ exports.clearCustomLogLevel = clearCustomLogLevel;
25
+ function getCustomLevel(name) {
26
+ return store_js_1.store.value.customLevels[name];
27
+ }
28
+ exports.getCustomLevel = getCustomLevel;
29
+ function getCustomLevelName(level) {
30
+ return store_js_1.store.value.customLevelsReverse[level];
31
+ }
32
+ exports.getCustomLevelName = getCustomLevelName;
33
+ function getCustomLevels() {
34
+ var customLevels = store_js_1.store.value.customLevels;
35
+ return (0, type_plus_1.mapKey)(customLevels, function (name) { return ({ name: name, level: customLevels[name] }); });
36
+ }
37
+ exports.getCustomLevels = getCustomLevels;
38
+ //# sourceMappingURL=customLogLevel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customLogLevel.js","sourceRoot":"","sources":["../ts/customLogLevel.ts"],"names":[],"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Y,EAAE,UAAA,IAAI,IAAI,OAAA,CAAC,EAAE,IAAI,MAAA,EAAE,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,EAArC,CAAqC,CAAC,CAAA;AAC5E,CAAC;AAHD,0CAGC","sourcesContent":["import { forEachKey, mapKey } from 'type-plus'\nimport { store } from './store.js'\nimport { LogLevelEntry } from './types.js'\n\n/**\n * @param level the `logLevel` number.\n * You can specify this in the form of `logLevel.<x> + n` to make it more readable.\n */\nexport function addCustomLogLevel(name: string, level: number) {\n const { customLevels, customLevelsReverse } = store.value\n customLevels[name] = level\n customLevelsReverse[level] = name\n const { loggerClosures } = store.value\n forEachKey(loggerClosures, id => loggerClosures[id].addMethod(name, level))\n}\n\nexport function clearCustomLogLevel() {\n const { customLevels, customLevelsReverse } = store.value\n // Don't replace the object would prevent reference divergence\n forEachKey(customLevels, k => delete customLevels[k])\n customLevelsReverse.splice(0, customLevelsReverse.length)\n}\n\nexport function getCustomLevel(name: string): number | undefined {\n return store.value.customLevels[name]\n}\n\nexport function getCustomLevelName(level: number): string | undefined {\n return store.value.customLevelsReverse[level]\n}\n\nexport function getCustomLevels(): LogLevelEntry[] {\n const { customLevels } = store.value\n return mapKey(customLevels, name => ({ name, level: customLevels[name] }))\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=customLogLevel.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customLogLevel.spec.d.ts","sourceRoot":"","sources":["../ts/customLogLevel.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var assertron_1 = __importDefault(require("assertron"));
7
+ var index_js_1 = require("./index.js");
8
+ var config_js_1 = require("./config.js");
9
+ var index_js_2 = require("./memory/index.js");
10
+ var store_js_1 = require("./store.js");
11
+ afterEach(function () { return store_js_1.store.reset(); });
12
+ describe('clearCustomLogLevel()', function () {
13
+ test('clear all custom levels', function () {
14
+ (0, index_js_1.addCustomLogLevel)('c1', index_js_1.logLevels.none + 1);
15
+ (0, index_js_1.addCustomLogLevel)('c2', index_js_1.logLevels.none + 2);
16
+ expect((0, index_js_1.getCustomLevels)().length).toBe(2);
17
+ (0, index_js_1.clearCustomLogLevel)();
18
+ expect((0, index_js_1.getCustomLevels)().length).toBe(0);
19
+ });
20
+ });
21
+ test('custom level will not write if log level is lower', function () {
22
+ var memReporter = (0, index_js_2.createMemoryLogReporter)();
23
+ (0, config_js_1.config)({
24
+ mode: 'test',
25
+ reporters: [memReporter]
26
+ });
27
+ (0, index_js_1.addCustomLogLevel)('c1', index_js_1.logLevels.debug + 1);
28
+ var log = (0, index_js_1.getLogger)('custom-level-not-write');
29
+ log.c1('will not write this');
30
+ expect(memReporter.logs.length).toEqual(0);
31
+ });
32
+ test('custom level method is readonly', function () {
33
+ (0, index_js_1.addCustomLogLevel)('c1', index_js_1.logLevels.debug + 1);
34
+ var log = (0, index_js_1.getLogger)('custom method readonly');
35
+ assertron_1.default.throws(function () { log.c1 = function () { }; });
36
+ });
37
+ //# sourceMappingURL=customLogLevel.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customLogLevel.spec.js","sourceRoot":"","sources":["../ts/customLogLevel.spec.ts"],"names":[],"mappings":";;;;;AAAA,wDAAyB;AACzB,uCAA0G;AAC1G,yCAAoC;AACpC,8CAA2D;AAC3D,uCAAkC;AAElC,SAAS,CAAC,cAAM,OAAA,gBAAK,CAAC,KAAK,EAAE,EAAb,CAAa,CAAC,CAAA;AAE9B,QAAQ,CAAC,uBAAuB,EAAE;IAChC,IAAI,CAAC,yBAAyB,EAAE;QAC9B,IAAA,4BAAiB,EAAC,IAAI,EAAE,oBAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAA;QAC3C,IAAA,4BAAiB,EAAC,IAAI,EAAE,oBAAS,CAAC,IAAI,GAAG,CAAC,CAAC,CAAA;QAC3C,MAAM,CAAC,IAAA,0BAAe,GAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAExC,IAAA,8BAAmB,GAAE,CAAA;QAErB,MAAM,CAAC,IAAA,0BAAe,GAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,mDAAmD,EAAE;IACxD,IAAM,WAAW,GAAG,IAAA,kCAAuB,GAAE,CAAA;IAC7C,IAAA,kBAAM,EAAC;QACL,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,CAAC,WAAW,CAAC;KACzB,CAAC,CAAA;IAEF,IAAA,4BAAiB,EAAC,IAAI,EAAE,oBAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;IAC5C,IAAM,GAAG,GAAG,IAAA,oBAAS,EAAO,wBAAwB,CAAC,CAAA;IACrD,GAAG,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAA;IAE7B,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;AAC5C,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,iCAAiC,EAAE;IACtC,IAAA,4BAAiB,EAAC,IAAI,EAAE,oBAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;IAC5C,IAAM,GAAG,GAAG,IAAA,oBAAS,EAAO,wBAAwB,CAAC,CAAA;IACrD,mBAAC,CAAC,MAAM,CAAC,cAAQ,GAAG,CAAC,EAAE,GAAG,cAAQ,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;AACxC,CAAC,CAAC,CAAA","sourcesContent":["import a from 'assertron'\nimport { addCustomLogLevel, clearCustomLogLevel, getCustomLevels, getLogger, logLevels } from './index.js'\nimport { config } from './config.js'\nimport { createMemoryLogReporter } from './memory/index.js'\nimport { store } from './store.js'\n\nafterEach(() => store.reset())\n\ndescribe('clearCustomLogLevel()', () => {\n test('clear all custom levels', () => {\n addCustomLogLevel('c1', logLevels.none + 1)\n addCustomLogLevel('c2', logLevels.none + 2)\n expect(getCustomLevels().length).toBe(2)\n\n clearCustomLogLevel()\n\n expect(getCustomLevels().length).toBe(0)\n })\n})\n\ntest('custom level will not write if log level is lower', () => {\n const memReporter = createMemoryLogReporter()\n config({\n mode: 'test',\n reporters: [memReporter]\n })\n\n addCustomLogLevel('c1', logLevels.debug + 1)\n const log = getLogger<'c1'>('custom-level-not-write')\n log.c1('will not write this')\n\n expect(memReporter.logs.length).toEqual(0)\n})\n\ntest('custom level method is readonly', () => {\n addCustomLogLevel('c1', logLevels.debug + 1)\n const log = getLogger<'c1'>('custom method readonly')\n a.throws(() => { log.c1 = () => { } })\n})\n"]}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../ts/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEjD,qBAAa,gBAAiB,SAAQ,WAAW;gBACnC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO;CAG5D;AACD,qBAAa,SAAU,SAAQ,gBAAgB;IAC1B,EAAE,EAAE,MAAM;gBAAV,EAAE,EAAE,MAAM;CAG9B;AAED,qBAAa,0BAA2B,SAAQ,gBAAgB;IAC3C,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;CAGlC;AAED,qBAAa,aAAc,SAAQ,gBAAgB;IAC9B,IAAI,EAAE,MAAM;IAAS,KAAK,EAAE,MAAM;IAAS,cAAc,EAAE,MAAM,EAAE;gBAAnE,IAAI,EAAE,MAAM,EAAS,KAAK,EAAE,MAAM,EAAS,cAAc,EAAE,MAAM,EAAE;CAGvF"}