@mongodb-js/compass-logging
Advanced tools
@@ -10,2 +10,4 @@ "use strict"; | ||
function emit(ipc, event, data) { | ||
// We use ipc.callQuiet instead of ipc.call because we already | ||
// print debugging messages below | ||
void ipc?.callQuiet?.(event, data); | ||
@@ -17,4 +19,5 @@ if (typeof process !== 'undefined' && typeof process.emit === 'function') { | ||
function createLogger(component) { | ||
// This application may not be running in an Node.js/Electron context. | ||
const ipc = is_electron_renderer_1.default | ||
? | ||
? // eslint-disable-next-line @typescript-eslint/no-var-requires | ||
require('hadron-ipc').ipcRenderer | ||
@@ -21,0 +24,0 @@ : null; |
@@ -10,2 +10,6 @@ "use strict"; | ||
function createGenericLogger(component, emit) { | ||
// Do not create an actual Writable stream here, since the callback | ||
// logic in Node.js streams would mean that two writes from the | ||
// same event loop tick would not be written synchronously, | ||
// allowing another logger's write to be written out-of-order. | ||
const target = { | ||
@@ -12,0 +16,0 @@ write(line, callback) { |
@@ -30,2 +30,3 @@ "use strict"; | ||
const noop = () => { | ||
// noop | ||
}; | ||
@@ -77,2 +78,8 @@ function createNoopLogger(component = 'NOOP-LOGGER') { | ||
exports.withLogger = withLogger; | ||
// To avoid dependency on mongodb-log-writer that will pull in a lot of Node.js | ||
// specific code we re-implement mongoLogId in the provider to re-export | ||
// | ||
// Disable prettier so that dupedLogId stays on the same line to be ignored by | ||
// the check-logids script | ||
// prettier-ignore | ||
function mongoLogId(id) { | ||
@@ -79,0 +86,0 @@ return { __value: id }; |
@@ -16,3 +16,3 @@ { | ||
"homepage": "https://github.com/mongodb-js/compass", | ||
"version": "0.0.0-next-7b276eedbfde417d8b9171f491efa2632efe6921", | ||
"version": "0.0.0-next-7be3eae26fb97b72561c73d043d0505e1992739c", | ||
"repository": { | ||
@@ -56,4 +56,4 @@ "type": "git", | ||
"debug": "^4.3.4", | ||
"hadron-app-registry": "0.0.0-next-7b276eedbfde417d8b9171f491efa2632efe6921", | ||
"hadron-ipc": "0.0.0-next-7b276eedbfde417d8b9171f491efa2632efe6921", | ||
"hadron-app-registry": "0.0.0-next-7be3eae26fb97b72561c73d043d0505e1992739c", | ||
"hadron-ipc": "0.0.0-next-7be3eae26fb97b72561c73d043d0505e1992739c", | ||
"is-electron-renderer": "^2.0.1", | ||
@@ -64,6 +64,6 @@ "mongodb-log-writer": "^1.4.2", | ||
"devDependencies": { | ||
"@mongodb-js/eslint-config-compass": "0.0.0-next-7b276eedbfde417d8b9171f491efa2632efe6921", | ||
"@mongodb-js/mocha-config-compass": "0.0.0-next-7b276eedbfde417d8b9171f491efa2632efe6921", | ||
"@mongodb-js/prettier-config-compass": "0.0.0-next-7b276eedbfde417d8b9171f491efa2632efe6921", | ||
"@mongodb-js/tsconfig-compass": "0.0.0-next-7b276eedbfde417d8b9171f491efa2632efe6921", | ||
"@mongodb-js/eslint-config-compass": "0.0.0-next-7be3eae26fb97b72561c73d043d0505e1992739c", | ||
"@mongodb-js/mocha-config-compass": "0.0.0-next-7be3eae26fb97b72561c73d043d0505e1992739c", | ||
"@mongodb-js/prettier-config-compass": "0.0.0-next-7be3eae26fb97b72561c73d043d0505e1992739c", | ||
"@mongodb-js/tsconfig-compass": "0.0.0-next-7be3eae26fb97b72561c73d043d0505e1992739c", | ||
"@types/chai": "^4.2.21", | ||
@@ -85,3 +85,3 @@ "@types/debug": "^4.1.9", | ||
}, | ||
"gitHead": "7b276eedbfde417d8b9171f491efa2632efe6921" | ||
"gitHead": "7be3eae26fb97b72561c73d043d0505e1992739c" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
47388
2.15%195
7.73%0
-100%