Skip to content

Commit 7e478d9

Browse files
committed
delete exports (LEVELS, channels)
1 parent af4a07c commit 7e478d9

3 files changed

Lines changed: 1 addition & 72 deletions

File tree

doc/api/logger.md

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -627,51 +627,6 @@ Serializes an HTTP response object for logging.
627627
logger.info('Response sent', { res });
628628
```
629629
630-
## `logger.LEVELS`
631-
632-
<!-- YAML
633-
added: REPLACEME
634-
-->
635-
636-
* {Object}
637-
638-
An object mapping log level names to their numeric values.
639-
640-
```js
641-
const { LEVELS } = require('node:logger');
642-
643-
console.log(LEVELS);
644-
// { trace: 10, debug: 20, info: 30, warn: 40, error: 50, fatal: 60 }
645-
```
646-
647-
## `logger.channels`
648-
649-
<!-- YAML
650-
added: REPLACEME
651-
-->
652-
653-
* {Object}
654-
655-
An object containing `diagnostics_channel` instances for each log level.
656-
Advanced users can subscribe directly to these channels.
657-
658-
The following channel names are used:
659-
660-
* `log:trace`
661-
* `log:debug`
662-
* `log:info`
663-
* `log:warn`
664-
* `log:error`
665-
* `log:fatal`
666-
667-
```js
668-
const { channels } = require('node:logger');
669-
670-
channels.info.subscribe((record) => {
671-
// Custom handling of info-level logs
672-
});
673-
```
674-
675630
## `logger.serialize`
676631
677632
<!-- YAML

lib/logger.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,6 @@ module.exports = {
541541
Logger,
542542
LogConsumer,
543543
JSONConsumer,
544-
LEVELS,
545-
channels,
546544
stdSerializers,
547545
serialize,
548546
};

test/parallel/test-log-basic.js

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require('../common');
55
const assert = require('node:assert');
66
const { describe, it } = require('node:test');
7-
const { Logger, LogConsumer, JSONConsumer, LEVELS, channels } = require('node:logger');
7+
const { Logger, LogConsumer, JSONConsumer } = require('node:logger');
88
const { Writable } = require('node:stream');
99

1010
// Test helper to capture log output
@@ -36,18 +36,6 @@ class TestStream extends Writable {
3636
}
3737
}
3838

39-
describe('LEVELS constant', () => {
40-
it('should export correct numeric values for all levels', () => {
41-
assert.strictEqual(typeof LEVELS, 'object');
42-
assert.strictEqual(LEVELS.trace, 10);
43-
assert.strictEqual(LEVELS.debug, 20);
44-
assert.strictEqual(LEVELS.info, 30);
45-
assert.strictEqual(LEVELS.warn, 40);
46-
assert.strictEqual(LEVELS.error, 50);
47-
assert.strictEqual(LEVELS.fatal, 60);
48-
});
49-
});
50-
5139
describe('Logger constructor', () => {
5240
it('should create a Logger instance', () => {
5341
const logger = new Logger();
@@ -553,15 +541,3 @@ describe('JSONConsumer flush and end', () => {
553541
consumer.end();
554542
});
555543
});
556-
557-
describe('channels export', () => {
558-
it('should export channel objects for all levels', () => {
559-
assert.strictEqual(typeof channels, 'object');
560-
assert.strictEqual(typeof channels.trace, 'object');
561-
assert.strictEqual(typeof channels.debug, 'object');
562-
assert.strictEqual(typeof channels.info, 'object');
563-
assert.strictEqual(typeof channels.warn, 'object');
564-
assert.strictEqual(typeof channels.error, 'object');
565-
assert.strictEqual(typeof channels.fatal, 'object');
566-
});
567-
});

0 commit comments

Comments
 (0)