Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

  1. Open a log file. Can be using a file descriptor, or stream or.
  2. Close a log file.
  3. Read the log file.
  4. Write to the log file
  5. 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:

  1. Date/time.
  2. Line number.
  3. Contextual name (e.g. name of function when the log entry is being written).
  4. Type (e.g. warning, error, etc)
  5. Description of what is being logged.
  6. 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:

  1. The source files.
  2. Screen print of the successful compilation.
  3. Screen print of the program run.
  4. 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 .c or .cpp file with the source code in it. This makes it reusable in other programs by providing the .h file and the .so (or dll) as an API for other programs to compile and link to. The whole point is to have reusable tool for logging funcitions.

Based upon a 100 point scale.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

3. What strategies might you use?

Answered: 1 week ago