Scale JS / @scale-codec/definition-runtime / Logger
Class: Logger
@scale-codec/definition-runtime.Logger
Prints tracked info to console
Example
import { Logger } from 'lib'
new Logger().mount()
// use decoding functions and see console output
Implements
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new Logger(config?
)
Parameters
Name | Type |
---|---|
config? | LoggerConfig |
Defined in
packages/definition-runtime/src/tracking/logger.ts:46
Properties
config
• Optional
config: LoggerConfig
Defined in
packages/definition-runtime/src/tracking/logger.ts:40
decodeCurrentDepth
• Private
decodeCurrentDepth: number
= 0
Defined in
packages/definition-runtime/src/tracking/logger.ts:43
decodeErrorHandled
• Private
decodeErrorHandled: boolean
= false
Defined in
packages/definition-runtime/src/tracking/logger.ts:44
decodeTracer
• Private
decodeTracer: DecodeTraceCollector
Defined in
packages/definition-runtime/src/tracking/logger.ts:42
Accessors
logDecodeErrors
• Private
get
logDecodeErrors(): boolean
Returns
boolean
Defined in
packages/definition-runtime/src/tracking/logger.ts:50
logDecodeOk
• Private
get
logDecodeOk(): boolean
Returns
boolean
Defined in
packages/definition-runtime/src/tracking/logger.ts:54
Methods
buildDecodeTree
▸ Private
buildDecodeTree(trace
, walker
): Fmt
Parameters
Name | Type |
---|---|
trace | DecodeTrace |
walker | Walker |
Returns
Fmt
Defined in
packages/definition-runtime/src/tracking/logger.ts:119
decode
▸ decode<T
>(loc
, walker
, decode
): T
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
loc | string |
walker | Walker |
decode | Decode <T > |
Returns
T
Implementation of
CodecTracker.decode
Defined in
packages/definition-runtime/src/tracking/logger.ts:58
mount
▸ mount(): void
Sets itself as current global tracker
Returns
void
Defined in
packages/definition-runtime/src/tracking/logger.ts:100
refineDecodeLoc
▸ refineDecodeLoc<T
>(loc
, decode
): T
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
loc | string |
decode | () => T |
Returns
T
Implementation of
CodecTracker.refineDecodeLoc
Defined in
packages/definition-runtime/src/tracking/logger.ts:92
unmount
▸ unmount(): void
Unmounts itself from 'current tracker' position. If it is not current, it throws
Returns
void