// static/js/hljs-log.js – einfache Log-Sprache für Flask-Logs
hljs.registerLanguage('flasklog', function(hljs) {
  return {
    contains: [
      // Zeitstempel
      {
        className: 'timestamp',
        begin: /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/,
        relevance: 10
      },
      // Log-Level
      {
        className: 'level',
        begin: /\| (INFO|WARNING|ERROR|DEBUG|CRITICAL) +\|/,
        relevance: 10,
        keywords: {
          literal: 'INFO WARNING ERROR DEBUG CRITICAL'
        }
      },
      // Traceback
      {
        className: 'traceback',
        begin: /Traceback/,
        end: /$/,
        contains: [
          hljs.BACKSLASH_ESCAPE,
          { className: 'file', begin: /File "/, end: /"/ }
        ]
      },
      // Dateipfad + Zeilennummer
      {
        className: 'path',
        begin: /\//,
        end: /:\d+/
      },
      hljs.QUOTE_STRING_MODE,
      hljs.NUMBER_MODE
    ]
  };
});