loonghao / photoshop-python-api

Python API for Photoshop.
https://loonghao.github.io/photoshop-python-api/
MIT License
632 stars 71 forks source link

Unable to adjust log level #211

Open davidianstyle opened 1 year ago

davidianstyle commented 1 year ago

Describe the bug There doesn't seem to be a way to easily adjust the log level (ie. INFO instead of DEBUG): templates py - MTG-Proxyshop - Visual Studio Code 11_28_2022 9_23_18 PM

This ends up flooding the logs making it hard to see useful information.

To Reproduce Steps to reproduce the behavior:

  1. Utilize the Photoshop API:
    
    from photoshop import api as ps

app = ps.Application() app.openDialog()

(do anything else with app)


2. Look at application logs to see `[DEBUG  ]` scattered throughout logs

**Expected behavior**
Ability to adjust log level to `DEBUG`, `INFO`, `WARNING`, `ERROR`, or `CRITICAL`.

**Screenshots**
See above

**Desktop (please complete the following information):**
- Windows version: Microsoft Windows 10 Pro (Version 10.0.19045 Build 19045)
- Photoshop version: Photoshop 2023 (Version 24.0.1) - OS: [e.g. Windows10, Windows7]
- Python version: 3.11.0

**Additional context**
N/A
loonghao commented 1 year ago

@davidianstyle I really want to know how you print these logs.

pyps API has no logs by default, and your logs look like they come from comtypes

davidianstyle commented 1 year ago

Hi @loonghao, you can reproduce by cloning this project: https://github.com/davidianstyle/MTG-Proxyshop.git

and then running (with Python 3.11):

  1. $ python311 -m pip install -r requirements.txt
  2. $ python311 -m pip install kivy --pre --no-deps --index-url https://kivy.org/downloads/simple/
  3. $ python311 -m pip install "kivy[base]" --pre --extra-index-url https://kivy.org/downloads/simple/
  4. $ python311 main.py
  5. In the application that opens up, click 'Render target'
  6. When Photoshop opens, select any image and let the application run
  7. You'll see the [DEBUG ] logs that I mentioned in the issue description