Loguru: TypeError: Level 'TRACE' already exists, you can't update its severity no

Created on 27 May 2020  路  1Comment  路  Source: Delgan/loguru

loguru 0.5.0

Traceback (most recent call last):
  File "D:/Tools/PenetrationTesting/2.Intelligence_Gathering/domain/OneForAll/oneforall.py", line 15, in <module>
    import dbexport
  File "D:\Tools\PenetrationTesting\2.Intelligence_Gathering\domain\OneForAll\dbexport.py", line 13, in <module>
    from common import utils
  File "D:\Tools\PenetrationTesting\2.Intelligence_Gathering\domain\OneForAll\common\utils.py", line 21, in <module>
    from config.log import logger
  File "D:\Tools\PenetrationTesting\2.Intelligence_Gathering\domain\OneForAll\config\log.py", line 26, in <module>
    logger.level(name='TRACE', no=5, color='<cyan><bold>', icon='鉁忥笍')
  File "C:\Users\pentest\.virtualenvs\OneForAll-4zkd7hGI\lib\site-packages\loguru\_logger.py", line 1516, in level
    raise TypeError("Level '%s' already exists, you can't update its severity no" % name)
TypeError: Level 'TRACE' already exists, you can't update its severity no

my code:
https://github.com/shmilylty/OneForAll/blob/master/config/log.py#L26

question

Most helpful comment

It was decided after discussions that the severity of a level should not be changed. You can remove no=5, no=10 and no=40 for levels "TRACE", "DEBUG" and "ERROR" and it will work fine.

Maybe I could update Loguru so that if the no is equal to the already configured severity, it does not raise an exception.

>All comments

It was decided after discussions that the severity of a level should not be changed. You can remove no=5, no=10 and no=40 for levels "TRACE", "DEBUG" and "ERROR" and it will work fine.

Maybe I could update Loguru so that if the no is equal to the already configured severity, it does not raise an exception.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gopichand995 picture Gopichand995  路  4Comments

volfco picture volfco  路  5Comments

shmilylty picture shmilylty  路  5Comments

ghost picture ghost  路  4Comments

AllanLRH picture AllanLRH  路  6Comments