From b371bff663a4e29fe673774fccf9bcc2ddba341c Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 22 Nov 2017 09:43:53 +0800 Subject: Improve logging format --- astro/21cm/get_slice_zfreq.py | 3 ++- astro/21cm/make_lightcone.py | 3 ++- astro/oskar/fits2skymodel.py | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'astro') diff --git a/astro/21cm/get_slice_zfreq.py b/astro/21cm/get_slice_zfreq.py index 5687160..f6b5dda 100755 --- a/astro/21cm/get_slice_zfreq.py +++ b/astro/21cm/get_slice_zfreq.py @@ -22,7 +22,8 @@ from astropy.cosmology import FlatLambdaCDM from z2freq import z2freq, freq2z -logging.basicConfig(level=logging.INFO) +logging.basicConfig(level=logging.INFO, + format="[%(levelname)s:%(lineno)d] %(message)s") logger = logging.getLogger() cosmo = FlatLambdaCDM(H0=71, Om0=0.27) diff --git a/astro/21cm/make_lightcone.py b/astro/21cm/make_lightcone.py index 75f0d19..08ce0af 100755 --- a/astro/21cm/make_lightcone.py +++ b/astro/21cm/make_lightcone.py @@ -76,7 +76,8 @@ from astropy.cosmology import FlatLambdaCDM from astropy.wcs import WCS -logging.basicConfig(level=logging.INFO) +logging.basicConfig(level=logging.INFO, + format="[%(levelname)s:%(lineno)d] %(message)s") logger = logging.getLogger() diff --git a/astro/oskar/fits2skymodel.py b/astro/oskar/fits2skymodel.py index 324ee2a..7d0295a 100755 --- a/astro/oskar/fits2skymodel.py +++ b/astro/oskar/fits2skymodel.py @@ -37,8 +37,7 @@ from astropy.wcs import WCS logging.basicConfig(level=logging.INFO, - format="%(asctime)s [%(levelname)s] %(message)s", - datefmt="%H:%M:%S") + format="[%(levelname)s:%(lineno)d] %(message)s") logger = logging.getLogger(os.path.basename(sys.argv[0])) -- cgit v1.2.2