You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@ncoderz/log-m8

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ncoderz/log-m8 - npm Package Compare versions

Comparing version
1.0.1
to
1.0.2
+1
-1
package.json
{
"name": "@ncoderz/log-m8",
"version": "1.0.1",
"version": "1.0.2",
"description": "Logging system for TypeScript / JavaScript",

@@ -5,0 +5,0 @@ "author": "RA Sewell <richard.sewell@ncoderz.com>",

+37
-18
# log-m8
A flexible, extensible logging system for TypeScript and JavaScript applications.
![Build & Test](https://github.com/ncoderz/superenum/actions/workflows/build-test.yml/badge.svg?branch=main)
![npm version](https://img.shields.io/npm/v/@ncoderz/log-m8)
![License](https://img.shields.io/badge/license-BSD--2--Clause-blue)
[![License](https://img.shields.io/badge/license-BSD--2--Clause-blue.svg)](LICENSE)
[![npm version](https://img.shields.io/npm/v/log-m8.svg)](https://www.npmjs.com/package/log-m8)
A fast, small, flexible and extensible logging system for TypeScript and JavaScript applications.
## Features

@@ -22,3 +25,3 @@

```bash
npm install log-m8
npm install @ncoderz/log-m8
```

@@ -29,3 +32,3 @@

```typescript
import { LogM8 } from 'log-m8';
import { LogM8 } from '@ncoderz/log-m8';

@@ -165,2 +168,14 @@ // Configure the logging system

### Supported Formatter Tokens
- `{timestamp}`: Formatted timestamp
- `{LEVEL}`: Uppercase level label (with optional colorization)
- `{level}`: Lowercase level name
- `{logger}`: Logger name
- `{message}`: Primary log message
- `{data}`: Additional data arguments
- `{context.*}`: Nested context properties
All tokens support accessing nested items with `data[0].property` like notation.
### Built-in Formatters

@@ -176,3 +191,3 @@

// Optional: custom format with token placeholders
format: '{timestamp} {LEVEL} [{logger}] {message} {data}',
format: ['{timestamp} {LEVEL} [{logger}]', '{message}', '{data}'],
// Optional: timestamp format ('iso', 'locale', or custom pattern)

@@ -185,10 +200,2 @@ timestampFormat: 'hh:mm:ss.SSS',

Supported tokens:
- `{timestamp}`: Formatted timestamp
- `{LEVEL}`: Uppercase level label (with optional colorization)
- `{level}`: Lowercase level name
- `{logger}`: Logger name
- `{message}`: Primary log message
- `{data}`: Additional data arguments
- `{context.*}`: Nested context properties

@@ -203,3 +210,5 @@ #### JSON Formatter

// Optional fields to include
fields: ['timestamp', 'level', 'logger', 'message', 'data', 'context']
format: ['timestamp', 'level', 'logger', 'message', 'data', 'context'],
// Pretty print
pretty: true
}

@@ -212,2 +221,6 @@ ```

### Supported Filter Tokens
See Supported Formatter Tokens.
### Built-in Filters

@@ -246,7 +259,11 @@

// Flush all appenders
LogM8.flushAppenders();
// Disable a filter for a specific appender
LogM8.disableFilter('sensitive-data', 'console');
// Flush all appenders
LogM8.flushAppenders();
// Enable a filter for a specific appender
LogM8.enableFilter('sensitive-data', 'console');
```

@@ -256,4 +273,6 @@

You can extend log-m8 with custom appenders, formatters, and filters:
You can extend log-m8 with custom appenders, formatters, and filters.
For example:
```typescript

@@ -260,0 +279,0 @@ class SlackAppenderFactory implements PluginFactory {