/** @file logger.h
 *
 *  @brief Batch
 *
 *  @ingroup ippToPsps
 *
 *  @author IfA
 *  Copyright 2011 Institute for Astronomy, University of Hawaii
 */

#ifndef IPPTOPSPS_LOGGER_H
#define IPPTOPSPS_LOGGER_H

// message types
typedef enum {

    MSG_INFO,
    MSG_ERROR,
    MSG_DEBUG,
    MSG_NONE

} MessageTypes;


/**
  Logger class.

  Prints either to stdout or a file
  */
typedef struct Logger {

    // fields
    FILE* file;
    struct timeval startTime;
    int8_t showDebug;

    // methods
    void (*print)(void* logger, const int8_t typeInt, const char* class, const char* fmt, ...);

    // destructor
    void (*destroy)();

} Logger;

// constructor
Logger* new_Logger(const char* path, const int8_t showDebug);

# endif // IPPTOPSPS_LOGGER_H 

