Question
Create a library (or class) of logging functions (objects) that perform: Open a log file. Can be using a file descriptor, or stream or. Close
Create a library (or class) of logging functions (objects) that perform:
- Open a log file. Can be using a file descriptor, or stream or.
- Close a log file.
- Read the log file.
- Write to the log file
- Flush last write (e.g. commit the buffered write contents of the I/O buffer to the file)
The output lines of the log file shall include:
- Date/time.
- Line number.
- Contextual name (e.g. name of function when the log entry is being written).
- Type (e.g. warning, error, etc)
- Description of what is being logged.
- Other user fields as desired or deemed necessary.
The programming language shall be C or C++.
One trick that is sometimes used in logging output is to separate the fields using a delimiter such as the vertical pipe (|). This is my suggestion. This allows for the log lines to be imported into Excel or a database structure to make the log file text searchable.
To test, write a program of any sort and use the functions noted above to create and log information to a log file.
What is to be turned in:
- The source files.
- Screen print of the successful compilation.
- Screen print of the program run.
- The output log file.
Info: The structure should be a header file (*.h) with the function prototypes in it (or class objects prototypes) and a
Based upon a 100 point scale.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started