write this c program requirements here are the requirements for error logging a func 4946988
write this c program REQUIREMENTS
Here are the requirements for error logging:
– A function called LogError must write an error message to a textfile, to the debug console, or to the
program console. This message must contain the followinginformation:
o Date and time of occurrence
o Error message (passed to the function as a parameter)
– Use #define statements to identify:
o The output mechanism for the errors (text file, debug console orprogram console)
o The file path for the text file for the error log
– Use conditional compile statements in the LogError function todetermine where the error message
output should go
Write a test program that demonstrates the use of the LogErrorfunction. Initially, write a program that does the
following WITHOUT the error logging:
– Ask for the user’s age
– If the input is non-numeric, you should give the user a friendlymessage stating that the input is nonnumeric
– If the input is null (empty string), you should give the user afriendly message stating that the input cannot
be blank
– If the input is less than 1 or greater than 110, you should givethe user a friendly message stating that the
input is out of range
– If the age is valid (positive integer), simply say “Thank You”and end the program
– If there is any error in the age, the age should be asked foragain
Once the program works, add error logging function calls inappropriate places to record where users make errors. . . .