Skip to content

Commit 69c8a31

Browse files
committed
Add warning log functionality and update constructor logging in FEAScriptModel
1 parent 27ff578 commit 69c8a31

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/FEAScript.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { assembleFrontPropagationMat } from "./solvers/frontPropagationScript.js
1616
import { assembleGeneralFormPDEMat, assembleGeneralFormPDEFront } from "./solvers/generalFormPDEScript.js";
1717
import { assembleHeatConductionMat, assembleHeatConductionFront } from "./solvers/heatConductionScript.js";
1818
import { runFrontalSolver } from "./methods/frontalSolverScript.js";
19-
import { basicLog, debugLog, errorLog } from "./utilities/loggingScript.js";
19+
import { basicLog, debugLog, warnLog, errorLog } from "./utilities/loggingScript.js";
2020

2121
/**
2222
* Class to implement finite element analysis in JavaScript
@@ -32,6 +32,9 @@ export class FEAScriptModel {
3232
this.boundaryConditions = {};
3333
this.solverMethod = "lusolve"; // Default solver method
3434
this.coefficientFunctions = null; // Add storage for coefficient functions
35+
warnLog(
36+
"FEAScript is provided “as is” without any warranty. The authors are not responsible for any damages or losses that may result from using the software. See the license for more details: https://github.com/FEAScript/FEAScript-core/blob/main/LICENSE"
37+
);
3538
basicLog("FEAScriptModel instance created");
3639
}
3740

src/utilities/loggingScript.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function logSystem(level) {
3434
*/
3535
export function debugLog(message) {
3636
if (currentLogLevel === "debug") {
37-
console.log("%c[DEBUG] " + message, "color: #2196F3; font-weight: bold;"); // Blue color for debug
37+
console.log("%c[DEBUG] " + message, "color: #2196F3; font-weight: bold;");
3838
}
3939
}
4040

@@ -43,15 +43,23 @@ export function debugLog(message) {
4343
* @param {string} message - Message to log
4444
*/
4545
export function basicLog(message) {
46-
console.log("%c[INFO] " + message, "color: #4CAF50; font-weight: bold;"); // Green color for basic info
46+
console.log("%c[INFO] " + message, "color: #4CAF50; font-weight: bold;");
4747
}
4848

4949
/**
5050
* Function to log error messages
5151
* @param {string} message - Message to log
5252
*/
5353
export function errorLog(message) {
54-
console.log("%c[ERROR] " + message, "color: #F44336; font-weight: bold;"); // Red color for errors
54+
console.log("%c[ERROR] " + message, "color: #F44336; font-weight: bold;");
55+
}
56+
57+
/**
58+
* Function to log warning messages
59+
* @param {string} message - Message to log
60+
*/
61+
export function warnLog(message) {
62+
console.log("%c[WARN] " + message, "color: #FF9800; font-weight: bold;");
5563
}
5664

5765
/**

0 commit comments

Comments
 (0)