type LoggingMethod = (...message: any[]) => void;
- type MethodFactory = (methodName: string, level: LogLevelNumbers, loggerName: string) => LoggingMethod;
+ type MethodFactory = (methodName: string, level: LogLevelNumbers, loggerName: string | symbol) => LoggingMethod;
interface RootLogger extends Logger {
/**
/**
* This gets you a new logger object that works exactly like the root log object, but can have its level and
- * logging methods set independently. All loggers must have a name (which is a non-empty string). Calling
- * getLogger() multiple times with the same name will return an identical logger object.
+ * logging methods set independently. All loggers must have a name (which is a non-empty string or a symbol)
+ * Calling * getLogger() multiple times with the same name will return an identical logger object.
* In large applications, it can be incredibly useful to turn logging on and off for particular modules as you are
* working with them. Using the getLogger() method lets you create a separate logger for each part of your
* application with its own logging level. Likewise, for small, independent modules, using a named logger instead
* circumstances.
* @param name The name of the produced logger
*/
- getLogger(name: string): Logger;
+ getLogger(name: string | symbol): Logger;
/**
* This will return you the dictionary of all loggers created with getLogger, keyed off of their names.
*/
getLoggers(): { [name: string]: Logger };
+
+ /**
+ * A .default property for ES6 default import compatibility
+ */
+ default: RootLogger;
}
interface Logger {