📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

sockslog

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sockslog

SocksLog is a logging utility that allows you to log messages with different levels (INFO, WARN, ERROR) both locally and remotely.

1.1.0
latest
npm
Version published
Weekly downloads
97
340.91%
Maintainers
1
Weekly downloads
 
Created
Source

SocksLog

SocksLog is a logging utility that allows you to log messages with different levels (INFO, WARN, ERROR) both locally and remotely.

Features

  • Log messages with different levels: INFO, WARN, ERROR
  • Remote logging to a database
  • Client for real-time log streaming
  • TypeScript support
  • Non-blocking background logging
  • Proper error stack trace handling
  • Automatically fully unpacks objects and arrays

Installation

npm install sockslog

Then create an account on https://kvs.wireway.ch and create a database and copy its ID from the URL and the access token using the button.

Usage

JavaScript Usage

Logger Usage without remote

const logger = require('sockslog');

logger.setup({
    noRemote: true
});

logger.info('Hello World');

Logger Usage with remote

const logger = require('sockslog');

logger.setup({
    accessToken: 'ENTER_YOUR_ACCESS_TOKEN',
    kvsId: 'ENTER_YOUR_ID'
});

logger.info('Hello World');

Logging Errors with Stack Traces

const logger = require('sockslog');

logger.setup({
    noRemote: true
});

try {
  throw new Error('Something went wrong');
} catch (err) {
  logger.error(err); // Will properly display the full stack trace
}

Client/Viewer Usage

const logger = require('sockslog');

logger.setup({
    accessToken: 'ENTER_YOUR_ACCESS_TOKEN',
    kvsId: 'ENTER_YOUR_ID'
});

logger.client()

TypeScript Usage

Logger Usage without remote

import logger from 'sockslog';

logger.setup({
    noRemote: true
});

logger.info('Hello World');

Logger Usage with remote

import logger from 'sockslog';

logger.setup({
    accessToken: 'ENTER_YOUR_ACCESS_TOKEN',
    kvsId: 'ENTER_YOUR_ID'
});

logger.info('Hello World');

Logging Errors with Stack Traces

import logger from 'sockslog';

logger.setup({
    noRemote: true
});

try {
  throw new Error('Something went wrong');
} catch (err) {
  logger.error(err); // Will properly display the full stack trace
}

Client/Viewer Usage

import logger from 'sockslog';

logger.setup({
    accessToken: 'ENTER_YOUR_ACCESS_TOKEN',
    kvsId: 'ENTER_YOUR_ID'
});

logger.client();

FAQs

Package last updated on 23 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