error
The error method logs error messages to the terminal using console.error with an automatic red color applied to all string arguments. Non-string arguments are passed through unchanged.
Signature
betterConsole.error(...args: any[]): void
Parameters
...args: One or more values to log. String arguments are automatically styled with red color.
Usage
import betterConsole from "ts-better-console";
// Log an error message (displayed in red)
betterConsole.error("Failed to connect to database");
// Log multiple arguments
betterConsole.error("File not found:", "config.json");
// Mix string and non-string arguments
betterConsole.error("Exit code:", 1);
Want to support this project?
If you find ts-better-console useful and want to support its development, consider starring the GitHub repository or buying me a coffee! Your support helps me dedicate more time to improving the library and adding new features.
Want to contribute to this project?
Contributions are welcome! If you're interested in improving the library, fixing bugs, or adding new features, feel free to check out the GitHub repository and submit a pull request. Whether you're a seasoned developer or new to open source, your contributions can make a difference!