LumaPictures / pymel

Python in Maya Done Right
Other
479 stars 130 forks source link

pymel.log location #365

Closed fredrikaverpil closed 8 years ago

fredrikaverpil commented 8 years ago

I'm a Maya user and a Pipeline TD, and I notice that pymel.log is being created using os.path.expanduser('~/pymel.log') (pymel.conf) when using Maya. I've asked Autodesk to change this so that the log file ends up somewhere within a Maya-created folder, rather than ending up in the user's home directory, which seems like bad practice to me.

The Autodesk devs asked me to create an issue here for this, as they just integrate pymel into Maya as-is. So my question basically is whether you can cater for Autodesk in this matter or if they will have to maintain this on their side when integrating pymel.

I could edit pymel.conf on all machines, but that would be a tedious thing to maintain for any new Maya release and I would much rather see this log file end up somewhere more convenient, when pymel is used from within Maya.

pmolodo commented 8 years ago

Hey Fredrik - you make a good point. If I were starting over, I'd take your suggestion and put it in the MAYA_APP_DIR - makes more sense there. Unfortunately, at this point if we changed it we'd be breaking backward compatibility... and as you already pointed out, it can be configured in the pymel.conf. If you don't want to edit it on every machine, you can set an environment variable, $PYMEL_CONF (or %PYMEL_CONF% if you're of a windows frame of mind) to point to a network-hosted location for a centralized pymel.conf. This is what we do.

fredrikaverpil commented 8 years ago

Awesome, I wasn't aware of PYMEL_CONF. That patches things up for me nicely. I totally understand the backwards-compabitility thing.

Cheers!

jamesplease commented 7 years ago

It's definitely worth making this change in the next major release that breaks backwards compat. Perhaps whenever v2.0.0 rolls around, if you're following semver?

rv-17 commented 6 years ago

How does it work?

e. g. export PYMEL_CONF="~/xyz.log" doesn't do anything.

pmolodo commented 6 years ago

@17plus9 - It's a bit more of a two-step process... at least if you're dealing with a large deployed group of machines, at your work, or whatever.

If you just want to change it on a single machine (ie, your personal machine, say), it's pretty easy - just find the pymel.conf file inside of your maya installation, find the [handler_fileHandler] section, then change the args=(os.path.expanduser('~pymel.log'), 'w') line to whatever you want.

If you ARE trying to change it for a deployed network of machines then the process becomes more like: