eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.2k stars 868 forks source link

Add maven module name to the logs #1133

Open turbanoff opened 4 months ago

turbanoff commented 4 months ago

Do you want to request a feature or report a bug? I want to request small logs improvement

What is the current behavior? Currently when plugin is in the action - it just redirects output of frontend tools to maven logger as is. Example from our TeamCity log:

[17:44:43] :     [Step 3/3]      [exec] <s> [webpack.Progress] 54% building 128/160 entries 910/948 dependencies 134/250 modules
[17:44:43] :     [Step 3/3]      [exec] <s> [webpack.Progress] 54% building 129/160 entries 919/954 dependencies 137/250 modules
[17:44:43] :     [Step 3/3]      [exec] <s> [webpack.Progress] 54% building 130/160 entries 919/954 dependencies 137/250 modules
[17:44:43] :     [Step 3/3]      [exec] <s> [webpack.Progress] 55% building 131/160 entries 919/954 dependencies 137/250 modules

It makes hard to distinguish which log line relates to which maven module. We have multi-module maven project and use parallel build. It means maven log contains logs of different modules mixed up.

What is the expected behavior? It would be nice to add module name in front of logs. Similar to what we have when we run maven with this option: -Dorg.slf4j.simpleLogger.showThreadName=true. Example:

[17:45:02] :     [Step 3/3] [mvn-builder-frontend] [INFO] --- flatten-maven-plugin:1.5.0:flatten (flatten) @ frontend ---
[17:45:02] :     [Step 3/3] [mvn-builder-frontend] [INFO] Generating flattened POM of project com.devexperts.xt.webbroker:frontend:pom:MASTER-SNAPSHOT...
[17:45:02] :     [Step 3/3] [mvn-builder-frontend] [INFO] 
[17:45:02] :     [Step 3/3] [mvn-builder-frontend] [INFO] --- kotlin-maven-plugin:1.8.21:compile (compile) @ frontend ---
[17:45:02] :     [Step 3/3] [mvn-builder-frontend] [WARNING] No sources found skipping Kotlin compile
[17:45:02] :     [Step 3/3] [mvn-builder-frontend] [INFO] 
[17:45:02] :     [Step 3/3] [mvn-builder-frontend] [INFO] --- maven-compiler-plugin:3.12.1:compile (java-compile) @ frontend ---
[17:45:02] :     [Step 3/3] [mvn-builder-frontend] [INFO] No sources to compile

Here we can see build logs from frontend module

Please mention your frontend-maven-plugin and operating system version. 1.15.0