Skip to content

Commit 597f0c6

Browse files
committed
Fix cli.py overriding the logging level to INFO
1 parent 68665a5 commit 597f0c6

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

openevolve/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def parse_args() -> argparse.Namespace:
4242
"-l",
4343
help="Logging level",
4444
choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
45-
default="INFO",
45+
default=None,
4646
)
4747

4848
parser.add_argument(

openevolve/database.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ def add(
194194

195195
if feature_key not in self.feature_map:
196196
# New cell occupation
197-
logging.info("New MAP-Elites cell occupied: %s", coords_dict)
197+
logger.info("New MAP-Elites cell occupied: %s", coords_dict)
198198
# Check coverage milestone
199199
total_possible_cells = self.feature_bins ** len(self.config.feature_dimensions)
200200
coverage = (len(self.feature_map) + 1) / total_possible_cells
201201
if coverage in [0.1, 0.25, 0.5, 0.75, 0.9]:
202-
logging.info("MAP-Elites coverage reached %.1f%% (%d/%d cells)",
202+
logger.info("MAP-Elites coverage reached %.1f%% (%d/%d cells)",
203203
coverage * 100, len(self.feature_map) + 1, total_possible_cells)
204204
else:
205205
# Cell replacement - existing program being replaced
@@ -208,7 +208,7 @@ def add(
208208
existing_program = self.programs[existing_program_id]
209209
new_fitness = safe_numeric_average(program.metrics)
210210
existing_fitness = safe_numeric_average(existing_program.metrics)
211-
logging.info("MAP-Elites cell improved: %s (fitness: %.3f -> %.3f)",
211+
logger.info("MAP-Elites cell improved: %s (fitness: %.3f -> %.3f)",
212212
coords_dict, existing_fitness, new_fitness)
213213

214214
self.feature_map[feature_key] = program.id
@@ -667,7 +667,7 @@ def _calculate_feature_coords(self, program: Program) -> List[int]:
667667
# Default to middle bin if feature not found
668668
coords.append(self.feature_bins // 2)
669669
# Only log coordinates at debug level for troubleshooting
670-
logging.debug(
670+
logger.debug(
671671
"MAP-Elites coords: %s",
672672
str({self.config.feature_dimensions[i]: coords[i] for i in range(len(coords))}),
673673
)

scripts/visualizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from flask import Flask, render_template, render_template_string, jsonify
88

99

10-
logger = logging.getLogger("openevolve.visualizer")
10+
logger = logging.getLogger(__name__)
1111
app = Flask(__name__, template_folder="templates")
1212

1313

@@ -164,7 +164,7 @@ def run_static_export(args):
164164
shutil.rmtree(static_dst)
165165
shutil.copytree(static_src, static_dst)
166166

167-
logging.info(
167+
logger.info(
168168
f"Static export written to {output_dir}/\nNote: This will only work correctly with a web server, not by opening the HTML file directly in a browser. Try $ python3 -m http.server --directory {output_dir} 8080"
169169
)
170170

0 commit comments

Comments
 (0)