๐Ÿฌ Candy Logger v2

March 16, 2026 ยท View on GitHub

A professional, zero-dependency browser logger with a table-view UI, tags, color-coded levels, action buttons, dark/light themes, and JSON export โ€” all in one floating panel.

๐Ÿš€ Live Demo

v2 Breaking Change โ€” Node.js / terminal support has been removed. Candy Logger is now browser-only. If you need the legacy terminal output, stay on v1.x.


โœจ Features

FeatureDescription
๐Ÿ“Š Table ViewLogs displayed in a structured table (Time, Level, Tags, Message, Actions)
๐Ÿท๏ธ TagsAttach custom colored tags (e.g. AUTH, API, DB, PERF) to any log
๐ŸŽจ 6 Log Levelslog ยท info ยท debug ยท success ยท warn ยท error โ€” each color-coded
โšก Action ButtonsCopy, bookmark, delete per row โ€” plus custom actions via config
๐ŸŒ— Dark / LightToggle themes on the fly with one-click switch
๐Ÿ” Search & FilterReal-time search + filter by level with live counts
๐Ÿ’พ ExportDownload all logs as a .json file
๐Ÿ“Œ Pin, Drag, ResizePin to stay visible, drag anywhere, resize from corner
๐Ÿ“ฆ Collapsible JSONLarge objects auto-collapse with preview; syntax-highlighted
๐Ÿš€ Zero ConfigOne line to start; just set forceUI: true
๐Ÿชถ Zero DependenciesNo runtime deps โ€” just your browser

๐Ÿ“ฆ Installation

npm install candy-logger

Or via CDN:

<script type="module">
  import { overrideConsole } from 'https://unpkg.com/candy-logger@latest/dist/index.js';
  overrideConsole({ forceUI: true });
</script>

๐Ÿš€ Quick Start

Call once in your entry file. Every console.log/info/warn/error/debug is automatically captured.

import { overrideConsole } from 'candy-logger';

overrideConsole({ forceUI: true });

// That's it โ€” use console as usual
console.log('Hello World!');
console.info('User signed in', { userId: 123 });
console.warn('Disk usage > 90%');
console.error('Payment failed', { code: 'CARD_DECLINED' });
console.debug('Render took 12ms');

Option 2 โ€” Direct API

import candy from 'candy-logger';

candy.log('App started');
candy.info('Config loaded', config);
candy.debug('Cache hit', { key });
candy.success('Build passed!');
candy.warn('Rate limit close');
candy.error('Uncaught', err);

๐Ÿท๏ธ Tagged Logging

Attach one or more tags to any log for easy categorization and filtering.

import { overrideConsole } from 'candy-logger';
const candy = overrideConsole({ forceUI: true });

// Single tag
candy.tagged(
  { label: 'AUTH', bg: 'rgba(139,92,246,.2)', color: '#a78bfa' },
  'info',
  'Token refreshed',
  { expiresIn: '1h' }
);

// Multiple tags
candy.tagged(
  [
    { label: 'DB', bg: 'rgba(234,179,8,.18)', color: '#eab308' },
    { label: 'SLOW', bg: 'rgba(239,68,68,.18)', color: '#f87171' }
  ],
  'warn',
  'Query took 3.1s',
  { query: 'SELECT * FROM orders' }
);

โš™๏ธ Configuration

overrideConsole({
  forceUI: true,               // Show UI even in production
  theme: 'dark',               // 'dark' | 'light' | 'auto'
  position: 'bottom-right',    // 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'full-bottom'
  maxLogs: 500,                // Max logs in memory (oldest removed first)
  collapsed: false,            // Start minimized
  defaultTags: [               // Tags applied to every log
    { label: 'v2.0', color: '#7aa2f7' }
  ],
  badgeText: 'DEV',            // Optional badge next to title
});

๐Ÿ–ผ๏ธ Framework Examples

React

// src/main.jsx
import { overrideConsole } from 'candy-logger';
overrideConsole({ forceUI: true });

// Now use console.log anywhere โ€” it's enhanced!
function App() {
  return <button onClick={() => console.log('Clicked!')}>Click</button>;
}

Vue

// main.js
import { createApp } from 'vue';
import { overrideConsole } from 'candy-logger';
import App from './App.vue';

overrideConsole({ forceUI: true });
createApp(App).mount('#app');

Angular

// main.ts
import { overrideConsole } from 'candy-logger';
overrideConsole({ forceUI: true });
platformBrowserDynamic().bootstrapModule(AppModule);

Svelte

<script>
  import { onMount } from 'svelte';
  import { overrideConsole } from 'candy-logger';
  const candy = overrideConsole({ forceUI: true });

  onMount(() => candy.success('Ready!'));
</script>

Next.js (client only)

'use client';
import { useEffect } from 'react';
import { overrideConsole } from 'candy-logger';

export default function Providers({ children }) {
  useEffect(() => { overrideConsole({ forceUI: true }); }, []);
  return <>{children}</>;
}

๐ŸŽฏ API

Log Methods

candy.log(...args)      // ๐Ÿ“ General log (blue)
candy.info(...args)     // โ„น๏ธ  Informational (cyan)
candy.debug(...args)    // ๐Ÿ› Debug (purple)
candy.success(...args)  // โœ… Success (green)
candy.warn(...args)     // โš ๏ธ  Warning (amber)
candy.error(...args)    // โŒ Error (red)

Tagged Logging

candy.tagged(tag | tag[], level, ...args)

Console Override

import { overrideConsole, restoreConsole } from 'candy-logger';

const logger = overrideConsole(options);

// ... your code ...

restoreConsole(logger); // Restore original console

Utilities

candy.getStats()   // { all: 10, log: 3, info: 2, ... }
candy.getLogs()    // LogEntry[]

๐Ÿ”ง Showing the UI

The UI is opt-in โ€” set forceUI: true to display it:

overrideConsole({ forceUI: true });
  • When forceUI is omitted or false, logs pass through to the native console with zero overhead
  • Works on any domain โ€” localhost, staging, production

๐Ÿ“ TypeScript

Fully typed. All interfaces are exported:

import type { LogLevel, LogEntry, LogTag, LogAction, CandyLoggerOptions } from 'candy-logger';

๐Ÿ“‹ Changelog

v2.0.0

๐Ÿ”ฅ Complete Rewrite โ€” Browser Only

  • Removed all Node.js / terminal support (blessed dependency dropped)
  • New table-view UI replacing the old list view
  • 6 log levels: added debug and success
  • Tagged logging with custom colors
  • Action buttons per row: copy, bookmark, delete
  • Dark / Light themes with one-click toggle
  • Export logs as JSON
  • Configurable position, max logs, default tags, badge text
  • Zero runtime dependencies
  • Full TypeScript rewrite with exported types

v1.x (Deprecated)

Legacy version with Node.js terminal support and list-based browser UI. Install candy-logger@1 if you need it.


๐Ÿ“„ License

MIT

๐Ÿค Contributing

Contributions are welcome! Open an issue or submit a PR.


Made with ๐Ÿฌ by shehari007