New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

clean-logify

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clean-logify

Lightweight console logger with tag filtering and color support

latest
npmnpm
Version
0.8.0
Version published
Maintainers
1
Created
Source

📦 clean-logify

A lightweight and customizable console logger for the browser.
Supports environments, colored tags, filtering, and multiple log levels.

🚀 Installation

npm install clean-logify

or

yarn add clean-logify

📌 Features

  • ✅ Enable/disable globally
  • 🎯 Per-tag settings (enable, color, time, bold)
  • ⏰ Timestamp
  • 📦 ESM + CJS support
  • ⚙️ Written in TypeScript

🧠 Usage

import cl from 'clean-logify';

// Configuration
cl.config({
  enabledAll: true, // Optional: you can use process.env.NODE_ENV === 'development' for dynamic environments
  tags: {
    TAG1: {
      color: '#4caf50',  
      isBold: true,      
      hasTime: true,      
      enabled: true       
    },
    TAG2: {
      color: '#ff9800', 
      isBold: false,
      hasTime: true,
      enabled: true
    },
    TAG3: {
      color: '#9c27b0',  
      isBold: true,
      hasTime: true,
      enabled: false      
    },
  },
});

// Logging examples
cl.log('User signed in', { name: 'Mike' }, [1, 2, 3], 'TAG1');
cl.info('Fetching data...', 'TAG2');
cl.warn('No UI theme selected', 'TAG3');
cl.error('Something went wrong', 'TAG2');

🛠️ Config Options

interface cleanlogifyConfig {
  enabledAll?: boolean; // default: true
  tags?: Record<string, {
    color?: string;      // default: '#03a9f4'
    isBold?: boolean;    // default: true
    hasTime?: boolean;   // default: true
    enabled?: boolean;   // default: true
  }>
}
OptionTypeDescription
enabledAllbooleanEnable/disable logging globally
tagsRecord<string, TagConfig>Configure each tag (color, bold, etc.)

🔧 CommonJS Example

const cl = require('clean-logify');

cl.config({
  enabledAll: true,
  tags: {
    debugTag: {
      color: 'teal',
      enabled: true,
    }
  }
});

cl.log('CJS works!', 'debugTag');

🖨️ Console Output Example

2025-04-13T22:18:51.199Z [TAG1] User signed in { name: 'Mike' } [ 1, 2, 3 ]
2025-04-13T22:18:51.219Z [TAG2] Fetching data...
2025-04-13T22:18:51.220Z [TAG3] No UI theme selected

Author

  • Behzad Bakhshayesh

Keywords

logger

FAQs

Package last updated on 15 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts