Can we set logger level on Maya's default logger?

Can we set logger level on Maya's default logger?

loicLG
Explorer Explorer
995 Views
0 Replies
Message 1 of 1

Can we set logger level on Maya's default logger?

loicLG
Explorer
Explorer

Hi There,

I'm trying to change the level of Maya's default logger so I can remove all the warning and useless information when saving or opening a file.

I've been googling for a while but I cannot find a way to do this.

The closest thing I found was

 

cmds.scriptEditorInfo(suppressWarning=True)

 

but it doesn't actually work in my case since it re logs all of the warnings when setting back to False. I'm assuming it's to be used in conjunction with the write history if you want to redirect the log into an external file (without capturing warnings).

 

So I figured, maybe I can just change the level of their logger just like I do on mine but I can't figure this out.

 

logger = logging.getLogger(__name__)
logger.setLevel(logging.CRITICAL)

 

 This still logs warnings so I'm assuming this is not finding the correct logger?

 

Any info? 

 

cheers

0 Likes
996 Views
0 Replies
Replies (0)