-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration-options.js
38 lines (34 loc) · 1.37 KB
/
configuration-options.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Configuration Options Example
* Demonstrates how to use different configuration options in ACL.
*/
const ACL = require("../index");
// Create an instance of ACL with custom configuration
const logger = ACL.getInstance({
logLevel: 1, // Set console log level
outputFilename: "app.log", // Enable file logging
outputFileLogLevel: 2, // Set file log level
includeTimestamps: true, // Include timestamps in log messages
includeMemoryUsage: true, // Include memory usage information
memoryUpdateInterval: 1000,
memoryDisplayMode: 1, // Display memory usage in MB
includeCallerInfo: true, // Include caller information
callerInfoLevel: 2, // Include caller info for log level 2 and above
includeInlineCallerInfo: true, // Include inline caller information
inlineCallerInfoLevel: 1, // Include inline caller info for log level 1 and above
includeStackTrace: true, // Include stack trace in error and fatal messages
generateReport: true, // Enable report generation
terminateOnFatal: true, // Terminate on fatal log
enableTimers: true, // Enable timer methods
});
function main() {
logger.debug("This is a debug message.");
logger.log("This is a log message.");
logger.info("This is an info message.");
logger.warn("This is a warning message.");
logger.error("This is an error message.");
logger.fatal("This is a fatal message.");
// Generate report
logger.report();
}
main();