Question: String - based Log Analyzer Task: Write a function log _ analyzer ( log _ string ) that analyzes a given string representing log data.
Stringbased Log Analyzer
Task: Write a function loganalyzerlogstring that analyzes a given string representing log data. The function should count the number of error
messages and return this count. An error message is identified by the keyword "ERROR" at the beginning of a line. The log data will be provided
as a single string where lines are separated by newline characters In
def loganalyzerlogstring:
# your implementation here
pass
# # Student Test Cases
# logsample "INF: User logged in
ERROR: Invalid password
INF: Security alert
ERROR: System overload"
# logsample "INF: Data updated
ERROR: Connection failed"
# logsample "WARNING: Low disk space
INF: File saved"
# assert loganalyzerlogsample
# assert loganalyzerlogsample
# assert loganalyzerlogsample
For each of the functions below, at least two examples are provided to test your functions.
functions will be tested both with examples provided in each question and with extra examples.
Each function has to be documented with docstrings In particular, each function has to have docstrings that specify: a description about what the function does while mentioning parameter names b preconditions, if any
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
