ulteam-scripts ULogger
ULogger class
Class for logging messages & errors to DOM and console.
Sample
import { ULogger } from "../../log/ULogger";
export class TestULogger {
public static Sample() {
const container = document.querySelector('.ms-formtable');
// log info text
ULogger.info(container, "Sample info text");
// log error in catch block
try {
throw new Error("Sample error");
}
catch (e) {
ULogger.error(container, e);
}
}
}
Methods
Name | Returns | Static | Description |
---|---|---|---|
error(container: Element | HTMLElement | null, e: Error, message: undefined | string) | void | Static |
Log error message container: Add log to this element as a first child element e: JS Error object message: Additional info |
info(container: Element | HTMLElement | null, message: string) | void | Static |
Log message or debug info container: Add log to this element as a first child element message: Log text |