Skip to content
Snippets Groups Projects
Verified Commit 2d84d783 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

tweak log levels

parent d87bbc60
Branches
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@ import matplotlib.pyplot as plt
import plot
import multi_bar
from error import GPLTError
from log import panic, success, info, set_level
from log import panic, success, info, set_level, debug
import os
import json
......@@ -21,7 +21,7 @@ def load_json(json_value: str, filename: str = None):
GPLTError.NO_SUCH_FILE,
f"{filename}: no such file",
)
info(f"loading JSON data from {filename}")
debug(f"loading JSON data from {filename}")
with open(filename, "r") as file:
try:
data = json.load(file)
......
......@@ -5,7 +5,7 @@ import shutil
from itertools import zip_longest
from error import GPLTError
from log import panic, warning, debug, info
from log import panic, warning, info, debug, trace
from typing import Any, Dict, List, Optional, Tuple, TypedDict
......@@ -193,7 +193,7 @@ def _plot_single(g: Graph, i: int, ax: matplotlib.axes.Axes) -> matplotlib.lines
xs, ys, es = _parse_graph_points(g["points"], name)
if len(xs) == 0:
debug(f"no point to plot for graph {name}")
warning(f"no point to plot for graph {name}")
line_style, error_alpha = _parse_graph_style(g)
......@@ -254,7 +254,7 @@ def check(graphs: Any):
point_fields = __get_class_fields(Point)
for i, g in enumerate(graphs):
debug(f"checking graph {i}")
trace(f"checking graph {i}")
if not isinstance(g, dict):
panic(
GPLTError.INVALID_ARGUMENTS,
......@@ -271,7 +271,7 @@ def check(graphs: Any):
)
if "style" in g:
debug(f"checking the `$.style` of graph {name}")
trace(f"checking the `$.style` of graph {name}")
_check_extra_class_fields(
g["style"], name, __get_class_fields(Style), sub_path=["style"]
)
......@@ -346,12 +346,12 @@ def plot(
legends = {}
for i, g in enumerate(graphs):
info(f"plotting graph {i}")
debug(f"plotting graph {i}")
line = _plot_single(g, i, ax)
legend = g.get("legend", "main" if "name" in g else None)
if legend is not None:
debug(f"adding legend of graph {i}")
trace(f"adding legend of graph {i}")
if legend not in legends:
legends[legend] = []
legends[legend] += [line]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment