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

@studio/log

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@studio/log - npm Package Compare versions

Comparing version
1.0.1
to
1.0.2
+4
-0
CHANGES.md
# Changes
## 1.0.2
🐛 Make it work with local symlinks
## 1.0.1

@@ -4,0 +8,0 @@

+30
-24

@@ -23,14 +23,20 @@ /*

const loggers = {};
let transform = createDefaultTransform();
let stream = null;
let muted = {};
let muted_all = null;
// Make it work with local symlinks:
let state = global['@studio/log'];
if (!state) {
state = global['@studio/log'] = {
loggers: {},
transform: createDefaultTransform(),
stream: null,
muted: {},
muted_all: null
};
}
function write(ns, topic, msg, data, error) {
const mutes = muted[ns];
const mutes = state.muted[ns];
if (mutes && (!mutes.length || mutes.indexOf(topic) !== -1)) {
return;
}
if (muted_all && muted_all.indexOf(topic) !== -1) {
if (state.muted_all && state.muted_all.indexOf(topic) !== -1) {
return;

@@ -55,3 +61,3 @@ }

}
transform.write(entry);
state.transform.write(entry);
}

@@ -74,10 +80,10 @@

function logger(ns) {
return loggers[ns] || (loggers[ns] = new Logger(ns));
return state.loggers[ns] || (state.loggers[ns] = new Logger(ns));
}
logger.out = function (out_stream) {
transform.unpipe(stream);
stream = out_stream;
if (stream) {
transform.pipe(stream);
state.transform.unpipe(state.stream);
state.stream = out_stream;
if (state.stream) {
state.transform.pipe(state.stream);
}

@@ -88,6 +94,6 @@ return this;

logger.transform = function (transform_stream) {
transform.unpipe(stream);
transform = transform_stream;
if (stream) {
transform.pipe(stream);
state.transform.unpipe(state.stream);
state.transform = transform_stream;
if (state.stream) {
state.transform.pipe(state.stream);
}

@@ -98,3 +104,3 @@ return this;

logger.mute = function (ns, ...topics) {
muted[ns] = topics;
state.muted[ns] = topics;
return this;

@@ -104,3 +110,3 @@ };

logger.muteAll = function (...topics) {
muted_all = topics;
state.muted_all = topics;
return this;

@@ -110,9 +116,9 @@ };

logger.reset = function () {
transform.unpipe(stream);
transform = createDefaultTransform();
stream = null;
muted = {};
muted_all = null;
state.transform.unpipe(state.stream);
state.transform = createDefaultTransform();
state.stream = null;
state.muted = {};
state.muted_all = null;
};
module.exports = logger;
{
"name": "@studio/log",
"version": "1.0.1",
"version": "1.0.2",
"description": "A tiny JSON logger with emoji support",

@@ -5,0 +5,0 @@ "bin": {