Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.1.0: Saving Everything #1

Merged
merged 3 commits into from
Jun 7, 2023
Merged

Release v1.1.0: Saving Everything #1

merged 3 commits into from
Jun 7, 2023

Conversation

emanuelfranklyn
Copy link
Member

Added support for logging to a file

  • [NEW] Added the fileProperties parameter to the Logger constructor, which includes the following properties:

    • enable: enable logging to a file (defaults to false) [If false all 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 logFolderPath with the name latest.log (defaults to true)

    • enableDebugLog?: if true, the debug log will be stored in the logFolderPath inside a folder named latestLogs with the name debug.log (defaults to true)

    • enableErrorLog?: if true, the error log will be stored in the logFolderPath inside a folder named latestLogs with the name error.log (defaults to false)

    • enableFatalLog?: if true, the fatal log will be stored in the logFolderPath inside a folder named fatal-crash with the name fatal-DATE.log (defaults to true)

    • 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)

  • [NEW] Added support to log objects, arrays, etc. Like the default console.log function.

  • [BREAKING] Changed the export of AutoLogEnd now importing the package will return the Logger class and an object named AutoLogEnd with the activate and deactivate functions.

  • [NEW] AutoLogEnd activate function now accepts a Logger instance as 2º parameter. If not given, it will create a new instance of Logger with the default parameters. Otherwise, it will use the given instance.

@emanuelfranklyn emanuelfranklyn added the enhancement New feature or request label Jun 7, 2023
@emanuelfranklyn emanuelfranklyn self-assigned this Jun 7, 2023
Copy link
Member

@LoboMetalurgico LoboMetalurgico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank You!

@LoboMetalurgico LoboMetalurgico merged commit 3e58a7c into release Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants