mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 14:32:28 +03:00
Start doing logging properly
This commit is contained in:
parent
3f43c121e5
commit
caa3d4eace
3 changed files with 81 additions and 87 deletions
6
fdroid
6
fdroid
|
@ -19,6 +19,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import sys
|
||||
import logging
|
||||
|
||||
commands = [
|
||||
"build",
|
||||
|
@ -54,6 +55,11 @@ def main():
|
|||
print_help()
|
||||
sys.exit(1)
|
||||
|
||||
verbose = any(s in sys.argv for s in ['-v', '--verbose'])
|
||||
|
||||
logging.basicConfig(format='%(levelname)s: %(message)s',
|
||||
level=logging.DEBUG if verbose else logging.INFO)
|
||||
|
||||
# Trick optparse into displaying the right usage when --help is used.
|
||||
sys.argv[0] += ' ' + command
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue