We created a simple Logger to help us with logging in the sdk. If you want you can use it and it works either as a static class or instantiate it. If you create an instance you can set the logging level and the name will be shown in the log.
Relevant types
exportenumLoggingLevel { DEBUG ="debug", INFO ="info", WARN ="warn", ERROR ="error",}
Static methods
// Sends a message to standard output with tag debugstatic debug(message: any, name =""): void;// Sends a message to standard output with tag infostatic info(message: any, name =""): void;// Sends a message to standard output with tag logstatic log(message: any, name =""): void;// Sends a message to standard error output with tag warnstatic warn(message: any, name =""): void;// Sends a message to standard error output with tag errorstatic error(message: any, name =""): void;
Constructor and class methods
// In the constructor we can pass a name that will always be added in the log// and a logging level to choose which level of logs you want to be logged.// If you choose logging level WARN only logger.warn and logger.error will be loggedconstructor(name ="", loggingLevel: LoggingLevel =LoggingLevel.INFO);// Sends a message to standard output with tag debug if logging level DEBUG or greaterdebug(message: any): void;// Sends a message to standard output with tag info if logging level INFO or greaterinfo(message: any): void;// Sends a message to standard output with tag log if logging level INFO or greaterlog(message: any): void// Sends a message to standard error output with tag warn if logging level WARN or greaterwarn(message: any): void;// Sends a message to standard error output with tag error if logging level ERRORerror(message: any): void;