Results for “info”

Showing 1–10 of 12

  1. Challenge

    Logging instead of print

    …the logging call for its level: logging.debug() , logging.info() , logging.warning() or logging.error() , and drop the level from the text, since the format adds it. With the level set to INFO , the…

    Fix the code Medium 2 stages logging debug info warning
  2. Challenge

    Entries per level

    Count the mission log's entries per level, INFO, WARN and ERROR, in a dict of counters, then count any level at all with get() when DEBUG lines turn up, and print the levels in alphabetical order.

    Write the code Easy 2 stages dictionaries counting get sorted
  3. Challenge

    Log line format

    Turn values into a log line like [T+00:12:05] INFO Engines nominal with an f-string, then build the timestamp from numbers with zero padding.

    Write the code Easy 2 stages f-strings print logs formatting
  4. Challenge

    Count warnings

    …are new lines. Don't be fooled A new entry has come in: INFO WARN light test complete . It's an INFO entry about the warning light, but the starter code now counts 4 warnings. Make the count match…

    Write the code Medium 3 stages strings count multi-line strings logs
  5. Challenge

    Counter

    …+= 1 . The output stays as it was: DEBUG: 2 ERROR: 1 INFO: 4 WARN: 3 Most common first Replace the sorted listing with one from the most common level down, using counts.most_common() , under a…

    Fix the code Easy 2 stages collections Counter most_common dictionaries
  6. Challenge

    Config loader

    …written as JSON: downlink_rate_kbps = "256" log_level = "INFO" log_levl = "DEBUG" retries = 12 safe_mode = "yes" timeout_s = 2.5 dict(DEFAULTS) makes the copy and update() fills it in…

    Write the code Hard 3 stages project json configuration validation
  7. Challenge

    Log analyser

    …first, and per hour, in time order: By level: WARN: 6 INFO: 5 ERROR: 2 By hour: 09:00: 4 10:00: 4 11:00: 5 Two Counter s do the counting; the hour is the first two characters of the time, plus ":00"…

    Write the code Hard 3 stages project logs parsing Counter
  8. Challenge

    Filter the log

    …use min_level in the first line of the output: LEVELS = ["INFO", "WARN", "ERROR"] # from least to most serious min_level = "WARN" # show this level and above WARN and above: 4 [T+00:12:05] WARN…

    Write the code Medium 2 stages for loop lists append filtering
  9. Challenge

    Log to a file

    …and print each line without its line break: [T+00:10:00] INFO Orbit insertion complete [T+00:12:05] WARN Battery 3 temperature high [T+00:14:47] ERROR Fuel valve 2 not responding The hidden tests also…

    Write the code Easy 2 stages files open with write
  10. Challenge

    Log formatter function

    …The output must stay exactly the same: [T+00:12:05] INFO Engines nominal Define the function at the top: def format_log(t, level, msg): , with return f"..." inside, using its own parameter names. Then…

    Fix the code Easy 2 stages functions def return refactoring