package main

import (
	"fmt"
	"maps"
	"slices"
)

func main() {
	count := map[string]int{}
	for _, level := range []string{"INFO", "WARN", "INFO", "ERROR", "INFO"} {
		count[level]++
	}

	// a map has no order, so sort its keys before you print
	for _, level := range slices.Sorted(maps.Keys(count)) {
		fmt.Println(level, count[level])
	}

	if n, ok := count["DEBUG"]; ok {
		fmt.Println("DEBUG", n)
	} else {
		fmt.Println("no DEBUG lines")
	}
	delete(count, "INFO")
	fmt.Println(len(count), "levels left")
}
