Skip to content
/ Logger Public

Logger javascript with option enable or disable console print logs

Notifications You must be signed in to change notification settings

nayo/Logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logger.js

Control logs for production systems and development.

Demo

Usage

Include in the main script the following (enable or disable logs)

//For production systems
Logger.disableLog();
//For development systems (Default)
Logger.enableLog();

And in the other scripts use the following for logger, (Theme Bootstrap)

Logger.success(var1,var2,...,varN);
Logger.info(var1,var2,...,varN);
Logger.warning(var1,var2,...,varN);
Logger.danger(var1,var2,...,varN);

Example

<!DOCTYPE html>
<html>
<head>
<title>Example Logger.js</title>
<script src="Logger.js"></script>
</head>
<body>

<h1>Hello world!!!</h1>

</body>
</html>
<script>
Logger.disableLog(); //disable logs
Logger.success("Alert type success", "This will not be shown");
Logger.info("Alert type info", "This will not be shown");
Logger.warning("Alert type warning", "This will not be shown");
Logger.danger("Alert type danger", "This will not be shown");

Logger.enableLog(); //enable logs
Logger.success("Alert type success");
Logger.info("Alert type info");
Logger.warning("Alert type warning");
Logger.danger("Alert type danger");

</script>

Result:

About

Logger javascript with option enable or disable console print logs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published