<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setLogSettings(state):
 """Update the current log settings. This can restore an old saved log settings object returned by getLogSettings @param state: the settings to set """


    global _DEBUG
    global _log_handlers
    global _log_handlers_limited

    (_DEBUG,
     categories,
     _log_handlers,
     _log_handlers_limited) = state

    for category in categories:
        registerCategory(category)