์ฝ์ ์ถ๋ ฅ์ ์์๊ณผ ๋ฉํ๋ฐ์ดํฐ(ํ์ผ๋ช , ํจ์๋ช , ๋ผ์ธ๋ฒํธ)๋ฅผ ์๋์ผ๋ก ์ถ๊ฐํ๋ Python ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋๋ค.
pip install eddmPrint๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ํฌํธํ๋ฉด ์๋์ผ๋ก ์์๋๋ฉฐ, ๊ธฐ๋ณธ print ํจ์๊ฐ ์๋์ผ๋ก ํ์ฅ๋ฉ๋๋ค:
import eddmPrint
# ๊ธฐ๋ณธ print ํจ์๊ฐ ์๋์ผ๋ก ํ์ฅ๋ฉ๋๋ค
print("ํ
์คํธ ๋ฉ์์ง") # ์๋์ผ๋ก ํ์ผ๋ช
, ํจ์๋ช
, ๋ผ์ธ ์ ๋ณด๊ฐ ์ถ๋ ฅ๋จimport eddmPrint
# ๊ธฐ๋ณธ ํ๋ฆฐํธ (print ํจ์๊ฐ ์๋์ผ๋ก ํ์ฅ๋จ)
print("๊ธฐ๋ณธ ๋ฉ์์ง")
# ๋ค์ํ ๋ฉ์์ง ํ์
eddmPrint.error("์๋ฌ ๋ฉ์์ง")
eddmPrint.success("์ฑ๊ณต ๋ฉ์์ง")
eddmPrint.warning("๊ฒฝ๊ณ ๋ฉ์์ง")
eddmPrint.info("์ ๋ณด ๋ฉ์์ง")
# ์ค๋ฐ๊ฟ์ด ํฌํจ๋ ๋ฉ์์ง
eddmPrint.println("์ค๋ฐ๊ฟ์ด ํฌํจ๋ ๋ฉ์์ง")from eddmPrint import Colors, Templates
# ์์ ์ง์ ์ค์
print("๋นจ๊ฐ์ ๋ฉ์์ง", color=Colors.RED)
print("์ด๋ก์ ๋ฉ์์ง", color=Colors.GREEN)
# ํ
ํ๋ฆฟ ์ค์
print("๊ฐ๋จํ ํ
ํ๋ฆฟ", template=Templates.SIMPLE)
print("์์ธํ ํ
ํ๋ฆฟ", template=Templates.DETAILED)from eddmPrint import EddmPrint
# ์๋ก์ด ์ธ์คํด์ค ์์ฑ
my_printer = EddmPrint(color="\033[36m", prefixTemplate="[DEBUG {file}:{line}]")
my_printer.start()
my_printer.print("์ปค์คํ
ํ๋ฆฐํฐ ํ
์คํธ")๋ค์๊ณผ ๊ฐ์ ์์ ์์๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค:
Colors.BLACKColors.REDColors.GREENColors.YELLOWColors.BLUEColors.MAGENTAColors.CYANColors.WHITEColors.BRIGHT_REDColors.BRIGHT_GREEN- ๋ฑ๋ฑ...
๋ค์๊ณผ ๊ฐ์ ํ ํ๋ฆฟ ์์๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค:
Templates.DEFAULT: "[ํ์ผ๋ช : {file} | ํจ์๋ช : {func} | ๋ผ์ธ: {line}]"Templates.SIMPLE: "[{file}:{line}]"Templates.FUNCTION_ONLY: "[ํจ์: {func}]"Templates.FILE_ONLY: "[ํ์ผ: {file}]"Templates.LINE_ONLY: "[๋ผ์ธ: {line}]"Templates.COMPACT: "{file}:{line}"Templates.DETAILED: "ํ์ผ: {file} | ํจ์: {func} | ๋ผ์ธ: {line}"
์ด ํ๋ก์ ํธ๋ GitHub Actions๋ฅผ ์ฌ์ฉํ์ฌ ์๋์ผ๋ก ๋ฆด๋ฆฌ์ค๋ฅผ ์์ฑํ๊ณ PyPI์ ๋ฐฐํฌํฉ๋๋ค. ์ ๋ฒ์ ์ ๋ฆด๋ฆฌ์คํ๋ ค๋ฉด ๋ค์ ๋จ๊ณ๋ฅผ ๋ฐ๋ฅด์ธ์:
- ์ฝ๋๋ฅผ ์์ ํ๊ณ ์ปค๋ฐํฉ๋๋ค.
- ๋ฒ์ ํ๊ทธ๋ฅผ ์์ฑํฉ๋๋ค:
git tag v0.1.0 git push origin v0.1.0
- GitHub Actions๊ฐ ์๋์ผ๋ก ๋ฆด๋ฆฌ์ค๋ฅผ ์์ฑํ๊ณ PyPI์ ๋ฐฐํฌํฉ๋๋ค.
์ด ํ๋ก์ ํธ๋ MIT ๋ผ์ด์ผ์ค๋ฅผ ๋ฐ๋ฆ ๋๋ค. ์์ธํ ๋ด์ฉ์ LICENSE๋ฅผ ์ฐธ์กฐํ์ธ์.