Skip to content

Commit

Permalink
matplotlib logger info 23:29
Browse files Browse the repository at this point in the history
  • Loading branch information
Preetam-Das26 committed Mar 18, 2024
1 parent d8da9c2 commit 34cab93
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 4 deletions.
2 changes: 2 additions & 0 deletions mslib/msui/mpl_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
OPENAIP_NOTICE = "Airspace data used comes from openAIP.\n" \
"Visit openAIP.net and contribute to better aviation data, free for everyone to use and share."
OURAIRPORTS_NOTICE = "Airports provided by OurAirports."
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.INFO)


class MapCanvas(basemap.Basemap):
Expand Down
4 changes: 4 additions & 0 deletions mslib/msui/mpl_pathinteractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
from mslib.msui import flighttrack as ft


mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.INFO)


def distance_point_linesegment(p, l1, l2):
"""Computes the distance between a point p and a line segment given by its
endpoints l1 and l2.
Expand Down
3 changes: 3 additions & 0 deletions mslib/msui/mpl_qtwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@
"plot_title_size": "default",
"axes_label_size": "default"}

mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.INFO)


class ViewPlotter:
def __init__(self, fig=None, ax=None, settings_tag=None, settings=None):
Expand Down
3 changes: 3 additions & 0 deletions mslib/mswms/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@
elif standard_name not in _TITLES:
_TITLES[standard_name] = standard_name.replace("_", " ")

mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.INFO)


def get_standard_names():
return _TARGETS
Expand Down
2 changes: 2 additions & 0 deletions mslib/mswms/mpl_hsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

BASEMAP_CACHE = {}
BASEMAP_REQUESTS = []
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.INFO)


class AbstractHorizontalSectionStyle(mss_2D_sections.Abstract2DSectionStyle):
Expand Down
2 changes: 2 additions & 0 deletions mslib/mswms/mpl_lsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

mpl.rcParams['xtick.direction'] = 'out'
mpl.rcParams['ytick.direction'] = 'out'
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.INFO)


class AbstractLinearSectionStyle(mss_2D_sections.Abstract2DSectionStyle):
Expand Down
2 changes: 2 additions & 0 deletions mslib/mswms/mpl_vsec.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@

mpl.rcParams['xtick.direction'] = 'out'
mpl.rcParams['ytick.direction'] = 'out'
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.INFO)


class AbstractVerticalSectionStyle(mss_2D_sections.Abstract2DSectionStyle):
Expand Down
8 changes: 4 additions & 4 deletions mslib/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def setup_logging(args):
# Console handler (suppress DEBUG by default)
ch = logging.StreamHandler()
if args.debug:
logger.setLevel(logging.DEBUG)
ch.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO)
ch.setLevel(logging.INFO)
ch.setFormatter(debug_formatter)
else:
logger.setLevel(logging.INFO)
Expand All @@ -79,8 +79,8 @@ def setup_logging(args):
except (OSError, IOError) as ex:
logger.error("Could not open logfile '%s': %s %s", logfile, type(ex), ex)
else:
logger.setLevel(logging.DEBUG)
fh.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO)
fh.setLevel(logging.INFO)
fh.setFormatter(debug_formatter)
logger.addHandler(fh)

Expand Down
3 changes: 3 additions & 0 deletions mslib/utils/mssautoplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
"bbox": dict(boxstyle="round", facecolor="white", alpha=0.5, edgecolor="none"), "fontweight": "bold",
"zorder": 4, "fontsize": 6, "clip_on": True}

mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.INFO)


def load_from_ftml(filename):
"""Load a flight track from an XML file at <filename>.
Expand Down

0 comments on commit 34cab93

Please sign in to comment.