Skip to content

Commit 7ac335e

Browse files
committed
gradle: Add LOGLEVEL envvar to control debug output
1 parent 5fc7ff1 commit 7ac335e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

gradle/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,9 @@ the manual commands above to ship in your Flatpak repository, so you can run:
122122
$ flatpak run --command=bash --share=network --filesystem=`pwd` -d org.freedesktop.Sdk//21.08 ./script.sh
123123
$ flatpak-gradle-generator.py gradle-log.txt gradle-dependencies.json
124124
```
125+
126+
If necessary, you can modify the level of output from the script by setting the
127+
`LOGLEVEL` environment variable to a [supported log level](https://docs.python.org/3/library/logging.html#logging-levels):
128+
```
129+
$ LOGLEVEL=debug flatpak-gradle-generator.py gradle-log.txt gradle-dependencies.json
130+
```

gradle/flatpak-gradle-generator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import hashlib
99
import logging
1010
import re
11+
import os
1112

1213
arches = {
1314
'linux-x86_64': 'x86_64',
@@ -63,6 +64,9 @@ def flatpak_arch_to_gradle_arch(arch):
6364
return rev_arches[arch]
6465

6566
def main():
67+
logging.basicConfig(
68+
level=os.environ.get('LOGLEVEL', 'WARNING').upper()
69+
)
6670
parser = argparse.ArgumentParser()
6771
parser.add_argument('input', help='The gradle log file')
6872
parser.add_argument('output', help='The output JSON sources file')

0 commit comments

Comments
 (0)