insert msg1@(LogMessage _ t1 _) (Node left msg2@(LogMessage _ t2 _) right)
  | t1 < t2 = Node (insert msg1 left) msg2 right
  | otherwise = Node left msg2 (insert msg1 right)
insert msg1@(LogMessage _ t1 _) (Node left msg2@(LogMessage _ t2 _) right)
  | t1 < t2 = Node (insert msg1 left) msg2 right
  | otherwise = Node left msg2 (insert msg1 right)
insert msg1@(LogMessage _ t1 _) (Node left msg2@(LogMessage _ t2 _) right)
  | t1 < t2 = Node (insert msg1 left) msg2 right
  | otherwise = Node left msg2 (insert msg1 right)