~ubuntu-branches/ubuntu/quantal/clustalo/quantal

« back to all changes in this revision

Viewing changes to src/clustal/log.h

  • Committer: Package Import Robot
  • Author(s): Olivier Sallou
  • Date: 2011-12-14 11:21:56 UTC
  • Revision ID: package-import@ubuntu.com-20111214112156-y3chwm0t4yn2nevm
Tags: upstream-1.0.3
ImportĀ upstreamĀ versionĀ 1.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: c; tab-width: 4; c-basic-offset: 4;  indent-tabs-mode: nil -*- */
 
2
 
 
3
/*********************************************************************
 
4
 * Clustal Omega - Multiple sequence alignment
 
5
 *
 
6
 * Copyright (C) 2010 University College Dublin
 
7
 *
 
8
 * Clustal-Omega is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU General Public License as
 
10
 * published by the Free Software Foundation; either version 2 of the
 
11
 * License, or (at your option) any later version.
 
12
 *
 
13
 * This file is part of Clustal-Omega.
 
14
 *
 
15
 ********************************************************************/
 
16
 
 
17
/*
 
18
 *  RCS $Id$
 
19
 */
 
20
 
 
21
 
 
22
#include <stdio.h>
 
23
#include <stdarg.h>
 
24
 
 
25
#ifndef LOG_H
 
26
#define LOG_H
 
27
 
 
28
 
 
29
#define LOG_DEBUG 0
 
30
#define LOG_VERBOSE 1
 
31
#define LOG_INFO 2
 
32
#define LOG_WARN 3
 
33
#define LOG_FORCED_DEBUG 4
 
34
#define LOG_ERROR 5
 
35
#define LOG_CRITICAL 6
 
36
#define LOG_FATAL 7
 
37
 
 
38
#define LOG_NUM_LEVELS 8
 
39
 
 
40
 
 
41
typedef struct {
 
42
    /* the higher the level, the more priority it has. numbers must be
 
43
     *  sequential 
 
44
     */
 
45
    
 
46
    /* array of function pointers */
 
47
    void (*prFunc[LOG_NUM_LEVELS]) (FILE *prFP, char *pcFormat, va_list rVArgList);
 
48
    FILE *prFP[LOG_NUM_LEVELS];
 
49
    char *prPrefix[LOG_NUM_LEVELS];
 
50
 
 
51
    /* everything above this level will be printed */
 
52
    int iLogLevelEnabled;
 
53
} log_t;
 
54
 
 
55
 
 
56
 
 
57
/* a standard logger */
 
58
extern log_t rLog;
 
59
 
 
60
 
 
61
 
 
62
void
 
63
LogDefaultSetup(log_t *log);
 
64
void
 
65
Log(log_t *prLog, int iLevel, char *pcFmt, ...);
 
66
void
 
67
LogSetFP(log_t *log, int level, FILE *fp);
 
68
void
 
69
LogSetFPForAll(log_t *log, FILE *fp);
 
70
FILE *
 
71
LogGetFP(log_t *prLog, int iLevel);
 
72
void
 
73
LogMute(log_t *log, int level);
 
74
void
 
75
LogMuteAll(log_t *log);
 
76
void
 
77
LogFuncOverwrite(log_t *prLog, int iLevel, 
 
78
                 void (*Func) (FILE *prFP, char *pcFormat, va_list rVArgList));
 
79
 
 
80
 
 
81
#endif