eulith-web3js-core
Version:
Eulith core web3js SDK (code to access Eulith services via web3js)
38 lines (37 loc) • 1.28 kB
TypeScript
export declare module Logging {
/**
* basic common obvious log levels (could be enhanced with more levels someday)
*
* \note - dont count on the numeric value of these enums, as it can change without notice. Only used for ordering
*/
enum LogLevel {
TRACE = 1,
INFO = 2,
WARNING = 3,
ERROR = 4
}
/**
* Interface used internally in Eulith-web3js code to generate logging calls. Can then be indirected to
* whatever logging tool (e.g. pino) you'd like.
*/
interface ILogger {
log(level: LogLevel, msg: string): any;
}
/**
* \brief ConsoleLogger can be used (with no dependencies except the 'console' object) - to generate logging
* for Eulith-web3js applications.
*
* This defaults to only showing messages LogLevel INFO or higher.
*
* \note - if you care about logging, this isn't intended to be very useful (just minimal/usable). Use Eulith-web3js-pino instead.
*/
class ConsoleLogger implements ILogger {
private minLogLevel_;
/**
*
* @param minLogLevel2Echo optional.
*/
constructor(minLogLevel2Echo?: LogLevel);
log(level: LogLevel, msg: string): void;
}
}