DebugLevel
The DebugLevel type defines the severity levels available for debug logging in ts-better-console. It is used to filter and categorize log messages based on their importance, making it easier to control which messages are displayed during development and debugging.
Type Definition
The DebugLevel type accepts the following string values:
"debug": The most verbose level, used for detailed debugging information."info": General informational messages about application flow."warn": Warning messages that indicate potential issues or unexpected behavior."error": Error messages indicating failures or critical issues.
type DebugLevel = "debug" | "info" | "warn" | "error";
Usage
You can use DebugLevel to set the minimum log level for your application, controlling which messages are displayed:
import { flag } from "ts-better-console";
// Only show warnings and errors
console.log(flag("warn", "This is a warning"));
// Show all messages including debug
console.log(flag("debug", "Detailed debug info"));
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!