MCPcopy
hub / github.com/ampproject/amphtml / initLogConstructor

Function initLogConstructor

src/utils/log.js:521–533  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

519 * Initializes log constructor.
520 */
521export function initLogConstructor() {
522 logConstructor = Log;
523 // Initialize instances for use. If a binary (an extension for example) that
524 // does not call `initLogConstructor` invokes `dev()` or `user()` earlier than
525 // the binary that does call `initLogConstructor` (amp.js), the extension will
526 // throw an error as that extension will never be able to initialize the log
527 // instances and we also don't want it to call `initLogConstructor` either
528 // (since that will cause the Log implementation to be bundled into that
529 // binary). So we must initialize the instances eagerly so that they are ready
530 // for use (stored globally) after the main binary calls `initLogConstructor`.
531 dev();
532 user();
533}
534
535/**
536 * Resets log constructor for testing.

Callers 15

experiments.jsFile · 0.90
initFunction · 0.90
initFunction · 0.90
ampcontext-lib.jsFile · 0.90
runtime.jsFile · 0.90
web-worker.jsFile · 0.90
loadPlayersMethod · 0.90
loadEntryPointsMethod · 0.90
install-alp.jsFile · 0.90
constructorMethod · 0.90

Calls 2

devFunction · 0.70
userFunction · 0.70

Tested by

no test coverage detected