Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

constructor

  • new Logger(): Logger
  • new Logger(id: string): Logger
  • new Logger(id: string, level: LogLevel): Logger
  • new Logger(id: string, sources: Iterable<ISubscribable<LogEntry>>, level?: LogLevel): Logger

Properties

Optional __owner

__owner: ISubscription<any, any>

Protected cacheLast

cacheLast: boolean

closeIn

closeIn: CloseMode

closeOut

closeOut: CloseMode

id

id: string

Protected last

last: any

level

level: LogLevel

This logger's configured minimum log level

Optional parent

parent: ISubscription<any, LogEntry>

sources

sources: Map<ISubscribable<LogEntry>, ISubscription<LogEntry, any>>

Protected state

state: State

Protected subs

subs: Partial<ISubscriber<LogEntry>>[]

Protected Optional wrapped

wrapped: Partial<ISubscriber<LogEntry>>

Protected Optional xform

xform: Reducer<LogEntry[], LogEntry>

Methods

add

  • Parameters

    Returns void

addAll

  • addAll(src: Iterable<ISubscribable<LogEntry>>): void
  • Parameters

    Returns void

debug

  • debug(...args: any[]): void

deref

  • Returns wrapped value.

    Returns undefined | LogEntry

Protected dispatch

  • Parameters

    Returns void

Protected dispatchTo

  • dispatchTo(type: "error" | "next" | "done", x?: LogEntry): boolean
  • Parameters

    • type: "error" | "next" | "done"
    • Optional x: LogEntry

    Returns boolean

Protected dispatchXform

  • Parameters

    Returns void

Protected dispatchXformDone

  • dispatchXformDone(): boolean
  • Returns boolean

Protected dispatchXformVals

  • Parameters

    Returns boolean

done

  • done(): void
  • Returns void

Protected ensureState

  • ensureState(): void
  • Returns void

error

  • error(e: any): boolean
  • Parameters

    • e: any

    Returns boolean

fine

  • fine(...args: any[]): void

getState

  • getState(): State
  • Returns State

info

  • info(...args: any[]): void

Protected log

  • log(level: LogLevel, args: any[]): void

map

  • map<C>(fn: Fn<LogEntry, C>, opts?: Partial<WithErrorHandlerOpts>): ISubscription<LogEntry, C>
  • Syntax sugar for {@link Subscription.transform} when using a single map transducer only. The given function fn is used as map's transformation fn.

    Type parameters

    • C

    Parameters

    • fn: Fn<LogEntry, C>
    • Optional opts: Partial<WithErrorHandlerOpts>

    Returns ISubscription<LogEntry, C>

Protected markDone

  • markDone(src: ISubscribable<LogEntry>): void
  • Parameters

    Returns void

next

Protected release

  • release(): void
  • Returns void

remove

  • remove(src: ISubscribable<LogEntry>): boolean
  • Parameters

    Returns boolean

removeAll

  • removeAll(src: Iterable<ISubscribable<LogEntry>>): boolean
  • Parameters

    Returns boolean

removeAllIDs

  • removeAllIDs(ids: Iterable<string>): boolean
  • Parameters

    • ids: Iterable<string>

    Returns boolean

removeID

  • removeID(id: string): boolean
  • Parameters

    • id: string

    Returns boolean

Protected setState

  • setState(state: State): void
  • Parameters

    • state: State

    Returns void

severe

  • severe(...args: any[]): void

subscribe

  • subscribe<C>(sub: ISubscription<LogEntry, C>): ISubscription<LogEntry, C>
  • subscribe(sub: Partial<ISubscriber<LogEntry>>, opts?: Partial<CommonOpts>): ISubscription<LogEntry, LogEntry>
  • subscribe<C>(sub: Partial<ISubscriber<C>>, opts?: Partial<TransformableOpts<LogEntry, C>>): ISubscription<LogEntry, C>
  • Creates new child subscription with given subscriber and/or transducer and options.

    Type parameters

    • C

    Parameters

    Returns ISubscription<LogEntry, C>

  • Wraps given partial sub in a {@link Subscription} and attaches it as child subscription.

    Parameters

    • sub: Partial<ISubscriber<LogEntry>>
    • Optional opts: Partial<CommonOpts>

    Returns ISubscription<LogEntry, LogEntry>

  • Wraps given partial sub in a {@link Subscription} and attaches it as child subscription.

    Type parameters

    • C

    Parameters

    • sub: Partial<ISubscriber<C>>
    • Optional opts: Partial<TransformableOpts<LogEntry, C>>

    Returns ISubscription<LogEntry, C>

transform

  • transform<C>(a: Transducer<LogEntry, C>, opts?: Partial<WithErrorHandlerOpts>): ISubscription<LogEntry, C>
  • transform<C, D>(a: Transducer<LogEntry, C>, b: Transducer<C, D>, opts?: Partial<WithErrorHandlerOpts>): ISubscription<LogEntry, D>
  • transform<C, D, E>(a: Transducer<LogEntry, C>, b: Transducer<C, D>, c: Transducer<D, E>, opts?: Partial<WithErrorHandlerOpts>): ISubscription<LogEntry, E>
  • transform<C, D, E, F>(a: Transducer<LogEntry, C>, b: Transducer<C, D>, c: Transducer<D, E>, d: Transducer<E, F>, opts?: Partial<WithErrorHandlerOpts>): ISubscription<LogEntry, F>
  • transform<C>(opts: WithTransform<LogEntry, C> & Partial<WithErrorHandlerOpts>): ISubscription<LogEntry, C>
  • Creates a new child subscription using given transducers and optional subscription ID. Supports up to 4 transducers and if more than one transducer is given, composes them in left-to-right order using {@link @thi.ng/transducers#(comp:1)}.

    Shorthand for subscribe(comp(xf1, xf2,...), id)

    Type parameters

    • C

    Parameters

    • a: Transducer<LogEntry, C>
    • Optional opts: Partial<WithErrorHandlerOpts>

    Returns ISubscription<LogEntry, C>

  • Type parameters

    • C

    • D

    Parameters

    • a: Transducer<LogEntry, C>
    • b: Transducer<C, D>
    • Optional opts: Partial<WithErrorHandlerOpts>

    Returns ISubscription<LogEntry, D>

  • Type parameters

    • C

    • D

    • E

    Parameters

    • a: Transducer<LogEntry, C>
    • b: Transducer<C, D>
    • c: Transducer<D, E>
    • Optional opts: Partial<WithErrorHandlerOpts>

    Returns ISubscription<LogEntry, E>

  • Type parameters

    • C

    • D

    • E

    • F

    Parameters

    • a: Transducer<LogEntry, C>
    • b: Transducer<C, D>
    • c: Transducer<D, E>
    • d: Transducer<E, F>
    • Optional opts: Partial<WithErrorHandlerOpts>

    Returns ISubscription<LogEntry, F>

  • Type parameters

    • C

    Parameters

    • opts: WithTransform<LogEntry, C> & Partial<WithErrorHandlerOpts>

    Returns ISubscription<LogEntry, C>

Protected unhandledError

  • unhandledError(e: any): boolean
  • Parameters

    • e: any

    Returns boolean

unsubscribe

  • unsubscribe(sub?: ISubscription<LogEntry, any>): boolean
  • Removes given child sub, or if sub is omitted, detaches this subscription itself from its upstream parent (possibly triggering a cascade of further unsubscriptions, depending on {@link CommonOpts.closeOut} settings of parent(s)).

    Parameters

    • Optional sub: ISubscription<LogEntry, any>

    Returns boolean

Protected unsubscribeChild

  • unsubscribeChild(sub: ISubscription<LogEntry, any>): boolean
  • Parameters

    Returns boolean

Protected unsubscribeSelf

  • unsubscribeSelf(): boolean
  • Returns boolean

warn

  • warn(...args: any[]): void

Generated using TypeDoc