log
The log method is the basic logging function in ts-better-console. It works like console.log but processes string arguments through the styling pipeline, allowing styled strings created with s to render properly in the terminal.
Signature
betterConsole.log(...args: any[]): void
Parameters
...args: Any number of arguments to log. String arguments are processed through the style pipeline, while non-string arguments are passed through as-is.
Usage
import betterConsole, { s } from "ts-better-console";
// Simple text log
betterConsole.log("Hello, world!");
// Log with styled text
betterConsole.log(s("Styled message", {color: "cyan",styles: ["bold"],}));
// Log multiple arguments
betterConsole.log("Count:", 42, "items");
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!