Skip to main content

Logger

Git Source

=============== 📊 Logger

State Variables​

CRITICAL​

string constant CRITICAL = "\u001b[91m[\xF0\x9F\x9A\xA8CRITICAL]\u001b[0m";

ERROR​

string constant ERROR = "\u001b[91m[\u2716 ERROR]\u001b[0m\n\t";

WARN​

string constant WARN = "\u001b[93m[WARNING]\u001b[0m";

INFO​

string constant INFO = "\u001b[92m[INFO]\u001b[0m";

DEBUG​

string constant DEBUG = "\u001b[94m[DEBUG]\u001b[0m";

Functions​

log​


💬 Logging​

function log(string memory message) internal pure;

log​

function log(string memory header, string memory message) internal pure;

logException​

function logException(string memory messageHead, string memory messageBody) internal view;

logCritical​

function logCritical(string memory messageHead) internal pure;

logError​

function logError(string memory message) internal view;

logWarn​

function logWarn(string memory message) internal view;

logInfo​

function logInfo(string memory message) internal view;

logDebug​

function logDebug(string memory message) internal view;

exportTo​


💾 Export Log​

function exportTo(string memory fileName) internal;

currentLevel​

function currentLevel() internal view returns (Level);

shouldLog​

function shouldLog(Level level) internal view returns (bool);

isDisable​

function isDisable() internal view returns (bool);

Enums​

Level​

enum Level {
Critical,
Error,
Warn,
Info,
Debug
}