Skip to content
On this page

Scale JS / @scale-codec/definition-runtime / Logger

Class: Logger

@scale-codec/definition-runtime.Logger

Prints tracked info to console

Example

ts
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

NameType
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

NameType
traceDecodeTrace
walkerWalker

Returns

Fmt

Defined in

packages/definition-runtime/src/tracking/logger.ts:119


decode

decode<T>(loc, walker, decode): T

Type parameters

Name
T

Parameters

NameType
locstring
walkerWalker
decodeDecode<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

NameType
locstring
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

Defined in

packages/definition-runtime/src/tracking/logger.ts:111