ngx-logger
Version:
[](https://www.npmjs.com/package/ngx-logger)
53 lines • 2.42 kB
TypeScript
import { HttpBackend } from '@angular/common/http';
import { SourceMap } from '@angular/compiler';
import { Observable } from 'rxjs';
import { INGXLoggerConfig } from '../config/iconfig';
import { INGXLoggerMetadata } from '../metadata/imetadata';
import { INGXLoggerLogPosition } from './ilog-position';
import { INGXLoggerMapperService } from './imapper.service';
import * as i0 from "@angular/core";
export declare class NGXLoggerMapperService implements INGXLoggerMapperService {
private httpBackend;
/** cache for source maps, key is source map location, ie. 'http://localhost:4200/main.js.map' */
protected sourceMapCache: Map<string, Observable<SourceMap>>;
/** cache for specific log position, key is the dist position, ie 'main.js:339:21' */
protected logPositionCache: Map<string, Observable<INGXLoggerLogPosition>>;
constructor(httpBackend: HttpBackend);
/**
* Returns the log position of the caller
* If sourceMaps are enabled, it attemps to get the source map from the server, and use that to parse the position
* @param config
* @param metadata
* @returns
*/
getLogPosition(config: INGXLoggerConfig, metadata: INGXLoggerMetadata): Observable<INGXLoggerLogPosition>;
/**
* Get the stackline of the original caller
* @param config
* @returns null if stackline was not found
*/
protected getStackLine(config: INGXLoggerConfig): string;
/**
* Get position of caller without using sourceMaps
* @param stackLine
* @returns
*/
protected getLocalPosition(stackLine: string): INGXLoggerLogPosition;
private getTranspileLocation;
/**
* Gets the URL of the sourcemap (the URL can be relative or absolute, it is browser dependant)
* @param stackLine
* @returns
*/
protected getSourceMapLocation(stackLine: string): string;
private getMapping;
/**
* does the http get request to get the source map
* @param sourceMapLocation
* @param distPosition
*/
protected getSourceMap(sourceMapLocation: string, distPosition: INGXLoggerLogPosition): Observable<INGXLoggerLogPosition>;
static ɵfac: i0.ɵɵFactoryDeclaration<NGXLoggerMapperService, [{ optional: true; }]>;
static ɵprov: i0.ɵɵInjectableDeclaration<NGXLoggerMapperService>;
}
//# sourceMappingURL=mapper.service.d.ts.map