Print Instead Of Logger (ARCH3157)
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Key typescript.logging.console-instead-of-logger · Severity warning · Category logging
Writing directly to stdout/stderr with console.log bypasses the framework logger. Log levels, structured fields, and centralized sinks are all lost.
Incorrect
Section titled “Incorrect”function processOrder(order: Order) { console.log("processing order: " + order.id); service.handle(order);}Correct
Section titled “Correct”function processOrder(order: Order) { logger.info("processing order", { orderId: order.id }); service.handle(order);}Use the structured framework logger instead of console.