Package VMBuilder :: Module log
[frames] | no frames]

Source Code for Module VMBuilder.log

 1  # 
 2  #    Uncomplicated VM Builder 
 3  #    Copyright (C) 2007-2008 Canonical Ltd. 
 4  #     
 5  #    See AUTHORS for list of contributors 
 6  # 
 7  #    This program is free software: you can redistribute it and/or modify 
 8  #    it under the terms of the GNU General Public License as published by 
 9  #    the Free Software Foundation, either version 3 of the License, or 
10  #    (at your option) any later version. 
11  # 
12  #    This program is distributed in the hope that it will be useful, 
13  #    but WITHOUT ANY WARRANTY; without even the implied warranty of 
14  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
15  #    GNU General Public License for more details. 
16  # 
17  #    You should have received a copy of the GNU General Public License 
18  #    along with this program.  If not, see <http://www.gnu.org/licenses/>. 
19  # 
20  #    Logging 
21   
22  import logging 
23   
24  FORMAT='%(asctime)s %(levelname)-8s %(message)s' 
25  logging.basicConfig(format=FORMAT, level=logging.INFO) 
26   
27 -def set_verbosity(option, opt_str, value, parser):
28 if opt_str == '--debug': 29 logging.getLogger().setLevel(logging.DEBUG) 30 elif opt_str == '--verbose': 31 logging.getLogger().setLevel(logging.INFO) 32 elif opt_str == '--quiet': 33 logging.getLogger().setLevel(logging.CRITICAL)
34