Isotropix Forums

ix.log_error() returns a RuntimeError

Clarisse Scripting related topics

ix.log_error() returns a RuntimeError

Unread postby mhamid3d » Tue Mar 03, 2020 8:12 pm

Simply running this code:

Code: Select all
ix.log_error('MY ERROR MESSAGE')


Returns this:

Code: Select all
>>> MY ERROR MESSAGE
>>> Traceback (most recent call last):
>>>   File "<string>", line 1, in <module>
>>>   File "", line 330, in log_error
   
>>> RuntimeError


ix.log_info and ix.log_warning work fine though.
mhamid3d
 
Posts: 8
Joined: Wed Dec 04, 2019 5:20 pm

Re: ix.log_error() returns a RuntimeError

Unread postby anemoff » Wed Mar 04, 2020 10:08 am

Hi,

Since 4.0 SP5 (bug #9429), log_error no longer raises a RuntimeError.
Previously this was an intended behavior but we have decided to remove it.

Cheers,
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 282
Joined: Wed Jan 13, 2016 10:10 am

Re: ix.log_error() returns a RuntimeError

Unread postby mhamid3d » Wed Mar 04, 2020 9:12 pm

Ah :(

Here's the workaround I tried if anyones interested. It will produce the log error but not the RunTimeError

Code: Select all
def custom_ix_logger(type=None, msg=None):
    if type=='error':
        try:
            ix.log_error('mytoolname | ERROR | {}'.format(msg))
        except:
            pass
mhamid3d
 
Posts: 8
Joined: Wed Dec 04, 2019 5:20 pm

Re: ix.log_error() returns a RuntimeError

Unread postby dboude » Thu Mar 05, 2020 9:29 am

Thanks for sharing !
Démian
Isotropix
Technical Artist - Clarisse Specialist
User avatar
dboude
 
Posts: 1418
Joined: Mon Jul 03, 2017 10:51 am


Return to Scripting