File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 11import { Log , stringify } from '../node.js'
22import { ecsSerializers } from './serializers.js'
3+ import { wrapConsole } from '../wrapConsole.js'
4+ import { wrapDebug } from '../wrapDebug.js'
35
46/**
57 * @typedef {import('../serializers/index.js').Serializer } Serializer
@@ -33,6 +35,23 @@ export class LogEcs extends Log {
3335 this . toJson = this . _toJson
3436 }
3537
38+ /**
39+ * @param {string } [name]
40+ * @param {LogOptionsEcs & LogOptionWrapConsole } [opts]
41+ * @returns {() => void } unwrap functions
42+ */
43+ static wrapConsole ( name = 'console' , opts ) {
44+ const log = new LogEcs ( name , opts )
45+ return wrapConsole ( log , opts )
46+ }
47+
48+ /**
49+ * @returns {() => void } unwrap functions
50+ */
51+ static wrapDebug ( ) {
52+ return wrapDebug ( LogEcs )
53+ }
54+
3655 /* c8 ignore next 18 */
3756 _applySerializers ( obj ) {
3857 const ecsObj = { }
Original file line number Diff line number Diff line change 1313 * (response) keys in objects
1414 */
1515export class LogEcs extends Log {
16+ /**
17+ * @param {string } [name]
18+ * @param {LogOptionsEcs & LogOptionWrapConsole } [opts]
19+ * @returns {() => void } unwrap functions
20+ */
21+ static wrapConsole ( name ?: string , opts ?: LogOptionsEcs & LogOptionWrapConsole ) : ( ) => void ;
1622 /**
1723 * @param {string } name logger namespace
1824 * @param {LogOptionsEcs } [opts]
You can’t perform that action at this time.
0 commit comments