How Do I Turn On Debug Logging?

Every engine has a debug_logging setting in the environment file. Turning this on will emit additional debug-level log messages to the default output in your DCC (eg. the script editor in Nuke or Maya). All of the apps running in your engine will emit these debug-level messages so turning this on for the engine will effectively turn it on for all of your apps as well.

This does not output any log messages to a file. We are working on a more standard logging framework that will allow this. The exceptions are SG Desktop and the Photoshop engine log output both in a GUI console and to a file.

 

Turning on debug logging for an engine in your DCC

For example, to turn on debugging output for the Nuke engine in the shot step environment, find the Nuke engine (tk-nuke) section in your environment file and update the setting to debug_logging: true

Edit  config/env/shot_step.yml

engines: 
...
...
tk-nuke:
apps:
...
...
compatibility_dialog_min_version: 9
debug_logging: true
favourite_directories: []
location: {name: tk-nuke, type: app_store, version: v0.2.23}
...
...

Save the file and re-launch your DCC in the shot step environment. You will now see the debug output in the script editor window. 

 

Turning on debug logging for the Shotgun engine

If you want to debug issues occurring when you're trying to launch Toolkit from the Shotgun web application, the process is mostly the same but you'll be editing the shotgun_*.yml environment file. For example, if you're launching from a Task in Shotgun, you'll want to turn on debug logging in the Shotgun engine in config/env/shotgun_task.yml

engines:

  tk-shotgun:
    apps:
      ...
      ...
    debug_logging: true
    location: {name: tk-shotgun, type: app_store, version: v0.5.1}

Save the file and reload the full page in the Shotgun web application. Then launch your Toolkit action. You will now see all the debug output in the panel that pops up inside of Shotgun.

 

Turning on debug logging for the tank command

If you're running the tank command and want to see debug output in your terminal, use the --debug option with the command you're running and this will turn on debug logging for the command.

./tank --debug core
DEBUG [10:11:38 617.835998535]:
DEBUG [10:11:38 618.768930435]: Running with debug output enabled.
DEBUG [10:11:38 618.921995163]:
DEBUG [10:11:38 619.092941284]: Core API resides inside a (localized) pipeline
configuration.
DEBUG [10:11:38 619.235992432]: Full command line passed:
['/sgtk/software/shotgun/scarlet/install/core/scripts/tank_cmd.py',
'/sgtk/software/shotgun/scarlet', '--debug', 'core']
DEBUG [10:11:38 619.364023209]:
DEBUG [10:11:38 619.463920593]:
DEBUG [10:11:38 619.575977325]: Code install root:
/sgtk/software/shotgun/scarlet
DEBUG [10:11:38 619.678020477]: Pipeline Config Root:
/sgtk/software/shotgun/scarlet
DEBUG [10:11:38 619.756937027]:
DEBUG [10:11:38 619.826078415]:
DEBUG [10:11:38 619.905948639]:
DEBUG [10:11:38 619.978904724]: Context items:
['/sgtk/software/shotgun/scarlet']
DEBUG [10:11:38 620.06688118]: Command: core
DEBUG [10:11:38 620.129108429]: Command Arguments: []
DEBUG [10:11:38 620.193004608]: Sgtk Pipeline Config Location:
/sgtk/software/shotgun/scarlet
DEBUG [10:11:38 620.270967484]: Location of this script (__file__):
/sgtk/software/shotgun/scarlet/install/core/scripts/tank_cmd.py
 
Welcome to the Shotgun Pipeline Toolkit!
For documentation, see https://toolkit.shotgunsoftware.com
Starting Toolkit for your current path '/sgtk/software/shotgun/scarlet'
- The path is not associated with any Shotgun object.
- Falling back on default project settings.
DEBUG [10:11:39 125.463962555]: Sgtk API and Context resolve complete.
DEBUG [10:11:39 126.449108124]: Sgtk API: Sgtk Core v0.15.18, config
/sgtk/software/shotgun/scarlet
DEBUG [10:11:39 126.588106155]: Context: scarlet
- Using configuration 'Primary' and Core v0.15.18
- Setting the Context to scarlet.
DEBUG [10:11:39 129.276990891]: No need to load up the engine for this
command.
- Running command core...
 
 
----------------------------------------------------------------------
Command: Core
----------------------------------------------------------------------
 
 
Welcome to the Shotgun Pipeline Toolkit update checker!
This script will check if the Toolkit Core API installed
in /sgtk/software/shotgun/scarlet
is up to date.
 
 
Please note that when you upgrade the core API, you typically affect more than
one project. If you want to test a Core API upgrade in isolation prior to
rolling it out to multiple projects, we recommend creating a special
*localized* pipeline configuration. For more information about this, please
see the Toolkit documentation.
 
 
You are currently running version v0.15.18 of the Shotgun Pipeline Toolkit
No need to update the Toolkit Core API at this time!
DEBUG [10:11:39 981.74405098]: Exiting with exit code None

 

 

Follow

1 Comments

  • 1
    Avatar
    Juanmaria Garcia

    I think it would be very useful an example of debugging code line to provide the user a complete reference.

Please sign in to leave a comment.