Fully configure logging in CLI tools.

This commit is contained in:
Chris PeBenito 2015-03-25 13:40:03 -04:00
parent 0fc61b0a54
commit c224995eeb
4 changed files with 20 additions and 8 deletions

7
sedta
View File

@ -100,9 +100,12 @@ if args.target and not (args.shortest_path or args.all_paths):
parser.error("An algorithm must be specified to determine a path.")
if args.debug:
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s|%(levelname)s|%(name)s|%(message)s')
elif args.verbose:
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.INFO, format='%(message)s')
else:
logging.basicConfig(level=logging.WARNING, format='%(message)s')
try:
p = setools.SELinuxPolicy(args.policy)

7
seinfo
View File

@ -87,9 +87,12 @@ queries.add_argument("--all", help="Print all of the above.",
args = parser.parse_args()
if args.debug:
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s|%(levelname)s|%(name)s|%(message)s')
elif args.verbose:
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.INFO, format='%(message)s')
else:
logging.basicConfig(level=logging.WARNING, format='%(message)s')
try:
p = setools.SELinuxPolicy(args.policy)

View File

@ -69,9 +69,12 @@ if args.limit_flows < 0:
parser.error("Limit on information flows cannot be negative.")
if args.debug:
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s|%(levelname)s|%(name)s|%(message)s')
elif args.verbose:
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.INFO, format='%(message)s')
else:
logging.basicConfig(level=logging.WARNING, format='%(message)s')
try:
p = setools.SELinuxPolicy(args.policy)

View File

@ -105,9 +105,12 @@ if not args.tertypes and not args.mlsrtypes and not args.rbacrtypes:
parser.error("At least one rule type must be specified.")
if args.debug:
logging.basicConfig(level=logging.DEBUG)
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s|%(levelname)s|%(name)s|%(message)s')
elif args.verbose:
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.INFO, format='%(message)s')
else:
logging.basicConfig(level=logging.WARNING, format='%(message)s')
try:
p = setools.SELinuxPolicy(args.policy)