API Reference

ErrorLogclass

Default implementation of IErrorLog for recording and streaming runtime errors.

Overview

Used for logging, diagnostics, and debugging helper output in core services.
Quick facts
Kind
class
Module
error-log
Implements
IErrorLog
Members
3
Package
@rs-x/core

Import

import { ErrorLog } from '@rs-x/core';

Example

import { InjectionContainer, RsXCoreInjectionTokens, RsXCoreModule, type IErrorLog } from '@rs-x/core';

await InjectionContainer.load(RsXCoreModule);

// Resolve from the container singleton (do not use new for this service).
const service = InjectionContainer.get<IErrorLog>(
  RsXCoreInjectionTokens.IErrorLog,
);
console.log(service);

Constructor injection example

import { Inject, RsXCoreInjectionTokens, type IErrorLog } from '@rs-x/core';

class MyConsumer {
  constructor(
    @Inject(RsXCoreInjectionTokens.IErrorLog)
    private readonly dependency: IErrorLog,
  ) {}
}

Members

3 members in this class.

constructor
constructorpublic
constructor()

Parameters

No parameters.

add
methodpublic
public add(error: IError): void

Parameters

Name
Type
Required
error
IError
required

Returns

void

clear
methodpublic
public clear(): void

Parameters

No parameters.

Returns

void