Skip to content

Commit

Permalink
[Screenshot] fix logs
Browse files Browse the repository at this point in the history
  • Loading branch information
japandotorg committed Sep 23, 2024
1 parent 3e983ba commit 85d1a37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion screenshot/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_service(self) -> Service:
return Service(
executable_path=str(self.cog.manager.driver_location),
service_args=["--log", "debug"],
log_output=str(self.cog.manager.logs_directory / "gecko.log"),
log_output=str(self.cog.manager.data_directory / "gecko.log"),
)

def get_options(self) -> Options:
Expand Down
10 changes: 2 additions & 8 deletions screenshot/common/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,13 @@ def __init__(self, session: Optional[aiohttp.ClientSession] = None) -> None:
def __environ(self) -> Dict[str, str]:
environ: Dict[str, str] = os.environ.copy()
if self.tor_location:
environ["LD_LIBRARY_PATH"] = (
os.getenv("LD_LIBRARY_PATH", "") + ":" + str(self.tor_location / "tor")
)
environ["LD_LIBRARY_PATH"] = str(self.tor_location / "tor")
return environ

@property
def data_directory(self) -> pathlib.Path:
return data_manager.cog_data_path(raw_name="Screenshot") / "data"

@property
def logs_directory(self) -> pathlib.Path:
return self.data_directory / "logs"

@property
def driver_location(self) -> Optional[pathlib.Path]:
return (
Expand Down Expand Up @@ -359,7 +353,7 @@ async def download_and_extract_tor(self) -> None:
Log debug file {}
DataDirectory {}
""".format(
self.logs_directory / "tor.log", self.tor_location / "teb-data"
self.data_directory / "tor.log", self.tor_location / "teb-data"
)
)
log.info("Downloaded tor successfully with location: {}".format(self.tor_location))

0 comments on commit 85d1a37

Please sign in to comment.