Skip to content

Commit 65fd534

Browse files
committed
Update logging system.
1 parent ebd72ab commit 65fd534

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

clone.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import sys, os, subprocess
22

3+
import sdl3.SDL
4+
35
os.environ["SDL_DOC_GENERATOR"] = "0"
46
os.environ["SDL_DISABLE_METADATA"] = "1"
57
os.environ["SDL_CHECK_BINARY_VERSION"] = "0"
@@ -13,11 +15,11 @@ def main(argv):
1315

1416
for repo, release in asyncio.run(sdl3.SDL_GET_LATEST_RELEASES()).items():
1517
if repo not in os.listdir():
16-
print("\33[32m", f"info: cloning '{repo}'", "without any release..." if (dev := release is None or not release.split("-")[1].startswith("3")) else f"with release '{release}'...", "\33[0m", sep = "", flush = True)
17-
subprocess.run(["git", "clone", f"https://github.com/libsdl-org/{repo}.git"] + ([] if "old" in os.listdir() else ["--recursive"]) + ([] if dev else ["--branch", release]), shell = sdl3.SDL_SYSTEM in ["Windows"])
18+
sdl3.SDL_LOGGER.Log(sdl3.SDL_LOGGER.Info, f"Cloning '{repo}' without any release..." if (dev := release is None or not release.split("-")[1].startswith("3")) else f"Cloning '{repo}' with release '{release}'...")
19+
subprocess.run(["git", "clone"] + ([] if "old" in os.listdir() else ["--recursive"]) + ([] if dev else ["--branch", release]) + [f"https://github.com/libsdl-org/{repo}.git"], shell = sdl3.SDL_SYSTEM in ["Windows"])
1820

1921
else:
20-
print("\33[35m", f"warning: passing '{repo}' because it already exists...", "\33[0m", sep = "", flush = True)
22+
sdl3.SDL_LOGGER.Log(sdl3.SDL_LOGGER.Warning, f"Skipping '{repo}' because it already exists...")
2123

2224
return 0
2325

0 commit comments

Comments
 (0)