Skip to content

Code-1543/ok-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🟒 ok-log

ok-log is a cute and handy global logging utility for JavaScript that enhances your console output with emojis and useful helpers β€” no need to import individual functions!

Just import 'ok-log' once and use log(), logError(), logSuccess() etc. anywhere globally.

✨ Features

  • πŸ“„ log(data) – Regular console.log
  • βœ… logSuccess(data) – Green success log
  • ❌ logError(error) – Error log with red alert
  • ⚠️ logWarn(warn) – Warning messages
  • ℹ️ logInfo(info) – Informational messages
  • 🐞 logDebug(debug) – For debugging
  • πŸ•’ logWithTime(data) – Log with current time
  • πŸ”„ clearLog() – Clear console
  • 😴 sleep(ms) – Delay execution
  • 🎲 pickRandom(arr) – Pick a random element
  • πŸ”’ randomInt(min, max) – Generate random integer

πŸš€ Installation

npm install ok-log

πŸš€ Usage

import 'ok-log';
//or
const {} = require('ok-log')

log('Hello!');
logSuccess('Operation complete!');
logError('Something went wrong');
logWarn('This is a warning');
logInfo('Some info for you');
logDebug('Debugging now...');
logWithTime('This happened now');

await sleep(1000);

log(pickRandom(['🍎', '🍌', 'πŸ‡']));
log(randomInt(1, 100));

➑️ Output

Hello!
βœ… Operation complete!
❌ Something went wrong
⚠️ This is a warning
ℹ️ Some info for you
🐞 Debugging now...
πŸ•’ [14:32:01] This happened now

//sleep 1 sec

πŸ‡ //pickRandom (random fruit)
57 //randomInt (random number between 1 and 100)

About

A cute and simple global logger for JavaScript with emojis and helper utilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors