- [FIXED] Minor bug caused by a missing parenthesis in the autoLogEnd
- [FIXED] Warning logs now use the correct console method to log to the terminal
- [CI] Full CI update in order to comply with the new npm publishing rules
- [DEPS] Updated dependencies to latest versions
- [DEPS] Updated dependencies to non-vulnerable versions
- [DEPS] Updated dependencies to non-vulnerable versions
- [BACKWARDS COMPATIBILITY] Automatically register the console engine if no engine is provided and you try to log something.
- [NEW] Strings with highlightable words separated by
/and\will be highlighted.
- [BREAKING] Full rewrite of the constructor and the way the logger works, logging methods however remain the same.
- [BREAKING] Removed the
filePropertiesparameter from the constructor, use instead new FileStorageEngine class for file logging. - [BREAKING] Removed the ability to log using html format.
- [BREAKING]
logFolderPathis now a required parameter for the FileStorageEngine class and will throw an error if not provided. - [BREAKING] Removed automatic terminal logging, use the new ConsoleEngine class for terminal logging.
- [BREAKING] AutoLogEnd is now a singleton class that should be instantiated apart from the Logger class.
- [NEW] Added support for string substitution patterns.
- [NEW] Added support for multiple loggers with different configurations to log to the same Engine.
- [NEW] Added support for a logger to output to multiple engines of same or different kind.
- [NEW] Added coloring to primitive types and certain keywords.
- [NEW] Added the ability to a logger to use different color settings, including custom ones.
- [NEW] Added support custom single, multi, or dynamic colored backgrounds and text colors for prefixes.
- [NEW] Added support for template literals to the logging.
- [NEW] AutoLogEnd now has the capacity of running deconstructor functions on application exit.
- [FIXED] Fixed a bug that caused logs that passed arguments to log the same thing twice
- [FIXED] Fixed typescript types for the
Loggerclass - [FIXED] Fixed an issue that caused having two logger instances logging to the same folder to cause a crash when the second instance tried to close the file stream
- [FIXED] Zip files timestamp now reflects the last modified time of the latest log file instead of the time of the zip creation
- [UPDATE] Fatal logs now are saved per fatal crash, instead of all fatal crashes of the same execution being saved to the same file
- [UPDATE] Fatal logs now have a 4 character random code at the start of the file name to prevent overwriting of files
- [UPDATE] Zip files now have a 4 character random code at the start of the file name to prevent overwriting of files
- [NEW] Added support for logging to a file
- [NEW] Added the
filePropertiesparameter to theLoggerconstructor which includes the following properties:- enable: enable logging to a file (defaults to
false) [Iffalseall the other properties will be ignored] - logFolderPath: path to the folder where the log files will be stored (will be created if it doesn't exist, defaults to
./logs) - enableLatestLog?: if true, the latest log file will be stored in the
logFolderPathwith the namelatest.log(defaults totrue) - enableDebugLog?: if true, the debug log will be stored in the
logFolderPathinside a folder namedlatestLogswith the namedebug.log(defaults totrue) - enableErrorLog?: if true, the error log will be stored in the
logFolderPathinside a folder namedlatestLogswith the nameerror.log(defaults tofalse) - enableFatalLog?: if true, the fatal log will be stored in the
logFolderPathinside a folder namedfatal-crashwith the namefatal-DATE.log(defaults totrue) - generateHTMLLog?: if true, the log files will be generated in HTML format (their extension will change from .log to .html) (defaults to
false) - compressLogFilesAfterNewExecution?: if true, the log files will be compressed to a zip file after a new execution of the program (defaults to
true)
- enable: enable logging to a file (defaults to
- [NEW] Added support to log objects, arrays and etc. Like the default
console.logfunction. - [BREAKING] Changed the export of AutoLogEnd. Now, importing the package will return the
Loggerclass and a object namedAutoLogEndwith theactivateanddeactivatefunctions. - [NEW] AutoLogEnd
activatefunction now accepts aLoggerinstance as 2º parameter. If not passed it will create a new instance ofLoggerwith the default parameters. otherwise it will use the passed instance.
- [NEW] Initial release of logger
- Supports Warning, Error, Info, Debug, and Fatal logging levels
- Supports colored output if specified