🍭
logzone a package to print pretty log messages. you can use predefined or customize your own!
⚙️
Installation npm install logzone
or
yarn add logzone
Methodes
the package has some built-in methods, the below graph explains them with the arguments.
Method | Description | arguments |
---|---|---|
log |
the method you can use for customization your log. |
log(msg, color, background , fontSize) - msg: the log message - required. - color: log text color - optional - type: string - default: "" . - background: log background color - optional - type: string - default: "" . - fontSize: log font size in px - optional - type: accept both number or string - default: browser default . |
success |
predefined method for success logs. |
success(msg, fontSize) - msg: the log message - required. - fontSize: log font size in px - optional - type: accept both number or string - default: browser default . |
info |
predefined method for info logs. |
info(msg, fontSize) - msg: the log message - required. - fontSize: log font size in px - optional - type: accept both number or string - default: browser default . |
warning |
predefined method for warning logs. |
warning(msg, fontSize) - msg: the log message - required. - fontSize: log font size in px - optional - type: accept both number or string - default: browser default . |
danger |
predefined method for error logs. |
danger(msg, fontSize) - msg: the log message - required. - fontSize: log font size in px - optional - type: accept both number or string - default: browser default . |
Feel free to open a pull requests and add your favorite theme too.
Examples...
ES.Next
import { log, success, info, warning, danger } from "logzone";
log("I'm customizable log!", "black", "red", 25 );
success("I'm predefined logzone baby success log!");
success("I'm predefined logzone baby success log, with custom font size!", 14);
info("I'm predefined logzone baby info log!");
info("I'm predefined logzone baby info log, with custom font size!", 14);
warning("I'm predefined logzone baby warning log!");
warning("I'm predefined logzone baby warning log, with custom font size!",14);
danger("I'm predefined logzone baby danger log!");
danger("I'm predefined logzone baby danger log, with custom font size!", 14);
Old School
<!-- Include latest version from https://www.jsdelivr.com/package/npm/logzone -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/logzone.min.js"></script>
<script>
logzone.log("I'm customizable log!", "black", "red", 25);
logzone.success("I'm predefined logzone baby success log!");
logzone.success("I'm predefined logzone baby success log, with custom font size!", 14);
logzone.info("I'm predefined logzone baby info log!");
logzone.info("I'm predefined logzone baby info log, with custom font size!", 14);
logzone.warning("I'm predefined logzone baby warning log!");
logzone.warning("I'm predefined logzone baby warning log, with custom font size!", 14);
logzone.danger("I'm predefined logzone baby danger log!");
logzone.danger("I'm predefined logzone baby danger log, with custom font size!", 14);
</script>
🔥
One Result!
Examples Links
✔️
Todo - add
init()
method. - add more themes.
- tailwind colors utils compatibility.
- add React hook.