Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/heft > IScopedLogger

IScopedLogger interface

A logger which is used to emit errors and warnings to the console, as well as to write to the console. Messaged emitted by the scoped logger are prefixed with the name of the scoped logger.

Signature:

export interface IScopedLogger 

Properties

PropertyModifiersTypeDescription
hasErrorsreadonlybooleanIndicates if the logger has emitted any errors.
loggerNamereadonlystringThe name of the scoped logger. Logging messages will be prefixed with this name.
terminalreadonlyITerminalThe terminal used to write messages to the console.

Methods

MethodDescription
emitError(error)Call this function to emit an error to the heft runtime.
emitWarning(warning)Call this function to emit an warning to the heft runtime.
resetErrorsAndWarnings()Reset the errors and warnings for this scoped logger.