From c6aa90bb4b91f0c95993810649bf5243de98d30b Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Thu, 18 Jan 2024 10:14:46 -0800 Subject: [PATCH] Update airspec logging doc --- docs/airspec.md | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/docs/airspec.md b/docs/airspec.md index a4aaa5f1f8..5d37c079fc 100644 --- a/docs/airspec.md +++ b/docs/airspec.md @@ -191,23 +191,6 @@ Test names will be checked as case-insensitive partial match, so you only need t ![image](https://wvlet.org/airframe/img/airspec/airspec.png) -### Configure Log Levels - -AirSpec natively supports [airframe-log](https://wvlet.org/airframe/docs/airframe-log.html) for logging. To temporally change the log level, use `-l (log level)` option: - -```scala -> testOnly -- -l debug -``` -This will set the log level to debug for all test classes. - - -To change the log level only for a specific package or a class, use `-L(package or class)=(log level)` option: - -```scala -> testOnly -- -Lorg.mydomain.myapp:debug -``` -You can use multiple `-L` options to set different log levels for multiple packages. - ### Disable Parallel Test Execution @@ -262,7 +245,25 @@ class MyTest extends AirSpec { Similarly, if you include `wvlet.log.LogSupport` to your application classes, you can add log messages to these classes. -### Changing Log Levels +### Configure Log Levels + +AirSpec natively supports [airframe-log](https://wvlet.org/airframe/docs/airframe-log.html) for logging. To temporally change the log level, use `-l (log level)` option: + +```scala +> testOnly -- -l debug +``` +This will set the log level to debug for all test classes. + + +To change the log level only for a specific package or a class, use `-L(package or class)=(log level)` option: + +```scala +> testOnly -- -Lorg.mydomain.myapp:debug +``` +You can use multiple `-L` options to set different log levels for multiple packages. + + +### Configure Log Levels in log-test.properties To change the log level for your packages and classes, add _log-test.properties_ file to your test resource folder `src/test/resources`. For multi-module projects, put this file under `(project folder)/src/test/resources` folder.