SMREmulator 1.0
ShingledMagneticRecordingEmulator

emulog.c File Reference

Implementation of logging functionality. More...

#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <emulog.h>
#include <emudebug.h>

Go to the source code of this file.

Functions

edi_lops_t * emulog_open (const char *log_file)
 Opens the log file for logging.
int emulog_close ()
 Closes the open log file.

Detailed Description

Implementation of logging functionality.

Author:
Anand Suresh <anandsur@andrew.cmu.edu>

No known bugs

Definition in file emulog.c.


Function Documentation

int emulog_close ( )

Closes the open log file.

Returns:
0 on success; -1 on failure

Definition at line 79 of file emulog.c.

edi_lops_t* emulog_open ( const char *  log_file)

Opens the log file for logging.

If the log file does not exist, it is created. If it already exists, then it is opened in append mode to continue logging.

Parameters:
log_filePath to the log file
Returns:
Pointer to the log callback function structure on success; NULL on failure

Definition at line 55 of file emulog.c.

Referenced by edi_init().