python · level 3 check
a shipped log analyser.
Time to ship a real tool. `logcheck` reads a server log and reports on it. The first line you type is its command line, like `--level warning --top 2`. Every line after that is a log line, until a line that says `END`.
Each log line has a time, a level and a message, like `09:15 ERROR disk full`. Lines that do not fit are skipped and counted, never crashed on. The levels are DEBUG, INFO, WARNING and ERROR, and `--level` hides anything less serious.
The report counts each level, ranks the most common messages and says how many lines were skipped. A bad option gets one polite sentence and exit code 2, not a traceback. Fill in each `____`, run it, then feed it a log of your own.
Fill in every ____ then run the checks.
- 1 It counts each leveluses: Counter
- 2 It hides less serious levels with --leveluses: argparse
- 3 It ranks the most common messages with --topuses: Counter
- 4 It skips bad lines without crashinguses: validating input
- 5 It rejects a bad option politelyuses: failing politely
- 6 It copes with an empty loguses: edge cases
Take as long as you like and try as many times as you want.
python · level 3 · expert
level up.
You passed every check and finished every level. You have the full set of faces.
- 28 lessons in this level
- 6 of 6 checks passed
This pass isn’t saved. A free account keeps your new face.