parseWatchtowerLog = (logMessage) => {
  try {
    // Extract the actual message content using regex
    const messageMatch = logMessage.match(/msg="([^"]+)"/);
    if (messageMatch) {
      const cleanMessage = messageMatch[1];

      // Skip certain messages that are not useful for the user
      if (
        cleanMessage.includes('Using no notifications') ||
        cleanMessage.includes('Waiting for the notification goroutine to finish')
      ) {
        return null;
      }

      // Format specific messages to be more user-friendly
      if (cleanMessage.includes('Watchtower')) {
        return `Starting Watchtower ${cleanMessage.match(/\d+\.\d+\.\d+/)[0]}`;
      }

      return cleanMessage;
    }

    // If no message content found, try to clean the raw message
    const cleanMessage = logMessage
      .replace(/[\x00-\x1F\x7F-\x9F]/g, '') // Remove control characters
      .replace(/^[DmHh>]\s*/, '') // Remove Docker stream prefixes
      .replace(/time="[^"]+" level=info msg="/, '') // Remove timestamp and level
      .replace(/"$/, ''); // Remove trailing quote

    return cleanMessage;
  } catch (e) {
    // If parsing fails, return the original message
    return logMessage;
  }
}
@description Parse a Watchtower log message to extract relevant information and remove Docker stream prefixes.
@example
parseWatchtowerLog('Dtime="2025-03-31T09:18:17Z" level=info msg="Watchtower 1.7.1"')
// Returns: "Starting Watchtower 1.7.1"
@param {string} logMessage - The raw log message.
@returns {string} Formatted log message.