Skip to content

Commit 64d5d47

Browse files
committed
fix logs
1 parent 5f448a1 commit 64d5d47

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

jupyddl/automated_planner.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from .dijkstra import DijkstraBestFirstSearch
44
from .a_star import AStarBestFirstSearch
55
from .heuristics import goal_count_heuristic, zero_heuristic
6-
import coloredlogs, logging
6+
import coloredlogs
7+
import logging
78
import julia
8-
99
_ = julia.Julia(compiled_modules=False, debug=False)
1010
from julia import PDDL
1111
from time import time as now
@@ -25,15 +25,21 @@ def __init__(self, domain_path, problem_path, log_level="DEBUG"):
2525
self.available_heuristics["goal_count"] = goal_count_heuristic
2626
self.available_heuristics["zero"] = zero_heuristic
2727

28-
# Logging
28+
# Logger
29+
self.__init_logger(log_level)
30+
self.logger = logging.getLogger("automated_planning")
31+
coloredlogs.install(level=log_level)
32+
33+
def __init_logger(self, log_level):
34+
import os
35+
if not os.path.exists('logs'):
36+
os.makedirs('logs')
2937
logging.basicConfig(
3038
filename="logs/main.log",
3139
format="%(levelname)s:%(message)s",
3240
filemode="w",
3341
level=log_level,
3442
) # Creates the log file
35-
self.logger = logging.getLogger("automated_planning")
36-
coloredlogs.install(level=log_level)
3743

3844
def transition(self, state, action):
3945
return self.pddl.transition(self.domain, state, action, check=False)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setuptools.setup(
1111
name="jupyddl", # Replace with your own username
12-
version="0.2.5",
12+
version="0.2.6",
1313
author="Erwin Lejeune",
1414
author_email="erwinlejeune.pro@gmail.com",
1515
description="Jupyddl is a PDDL planner built on top of a Julia parser",

0 commit comments

Comments
 (0)