()
| 519 | * Initializes log constructor. |
| 520 | */ |
| 521 | export 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. |
no test coverage detected