Verified Commit 338d323d authored by mo's avatar mo
Browse files

Add option to change the log level

* Add CHANGELOG entry and bump version
* Change default log level to `warn`
* Log stderr output if exit status is not successful
parent 2d200e2b
# GitLab License management changelog
## v3.6.0
- Change default log level to `warn`. (!132)
- Allow control of the log level via the `LOG_LEVEL` environment variable. (!132)
## v3.5.0
- Improve license detection in go modules projects. (!129)
......
PATH
remote: .
specs:
license-management (3.5.0)
license-management (3.6.0)
license_finder (~> 6.0.0)
spandx (~> 0.1)
......
......@@ -112,6 +112,7 @@ The License Management tool can be customized with environments variables for so
| LICENSE_FINDER_CLI_OPTS | * | Additional arguments for the `license_finder` executable. |
| LM_JAVA_VERSION | Java (Maven) | Version of Java. If set to `11`, Maven and Gradle use Java 11 instead of Java 8. |
| LM_PYTHON_VERSION | Python | Version of Python. If set to `3`, dependencies are installed using Python 3 instead of Python 2.7. |
| LOG_LEVEL | * | Control the verbosity of the logs. (`debug`, `info`, `warn` (default), `error`, `fatal`) |
Inject the required environment variables to the docker command using the [`--env` option flag](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file)
......
......@@ -24,7 +24,7 @@ module License
end
def self.logger
@logger ||= Logger.new(STDOUT)
@logger ||= Logger.new(STDOUT, level: ENV.fetch('LOG_LEVEL', Logger::WARN))
end
end
end
......@@ -16,7 +16,7 @@ module License
stdout, stderr, status = Open3.capture3(env, expanded_command)
logger.debug(stdout) unless stdout.nil? || stdout.empty?
logger.error(stderr) unless stderr.nil? || stderr.empty?
logger.error(stderr) unless status.success?
[stdout, stderr, status]
end
......
......@@ -2,6 +2,6 @@
module License
module Management
VERSION = '3.5.0'
VERSION = '3.6.0'
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment