input: Write a function to check for syntax errors, runtime errors, and logic errors in a given piece of code. The function should also add logging and debugging statements, and optionally use a debugger. 
  assert check_code_errors("def func(): print('Hello')") == "No errors"
  assert check_code_errors("def func(): print('Hello'") == "SyntaxError"
  assert check_code_errors("print(1/0)") == "ZeroDivisionError"
  assert check_code_errors("a = [1, 2, 3]\nprint(a[5])") == "IndexError"
output: import ast
  import traceback
  import logging
  
  logging.basicConfig(level=logging.DEBUG)
  
  def check_code_errors(code):
      # Check for Syntax Errors
      try:
          ast.parse(code)
      except SyntaxError:
          return "SyntaxError"
  
      # Check for Runtime Errors and Logic Errors
      try:
          exec(code)
          return "No errors"
      except Exception as e:
          error_type = type(e).__name__
          logging.debug(traceback.format_exc())
          return error_type