dtkLogger.h 1.37 KB
Newer Older
1
2
3
4
5
6
/* dtkLogger.h --- 
 * 
 * Author: Julien Wintz
 * Copyright (C) 2008-2011 - Julien Wintz, Inria.
 * Created: Thu Mar  1 17:18:31 2012 (+0100)
 * Version: $Id$
7
8
9
 * Last-Updated: mar. avril 24 15:02:52 2012 (+0200)
 *           By: Nicolas Niclausse
 *     Update #: 33
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 */

/* Commentary: 
 * 
 */

/* Change log:
 * 
 */

#ifndef DTKLOGGER_H
#define DTKLOGGER_H

#include "dtkLog.h"
#include "dtkLogExport.h"

#include <QtCore>
27
#include <QtGui>
28
29

class dtkLoggerPrivate;
Julien Wintz's avatar
Julien Wintz committed
30
class dtkLogDestination;
Julien Wintz's avatar
Julien Wintz committed
31
class dtkLogModel;
32
33
34
35
36
37
38
39
40
41
42

class DTKLOG_EXPORT dtkLogger
{
public:
    static dtkLogger& instance(void);

public:
    dtkLog::Level level(void) const;

public:
    void setLevel(dtkLog::Level level);
43
    void setLevel(QString level);
44
45
46
47
48
49
50
51
52

public:
    void attachConsole(void);
    void detachConsole(void);

public:
    void attachFile(const QString& path);
    void detachFile(const QString& path);

53
54
55
56
public:
    void attachText(QPlainTextEdit *editor);
    void detachText(QPlainTextEdit *editor);

Julien Wintz's avatar
Julien Wintz committed
57
public:
Julien Wintz's avatar
Julien Wintz committed
58
59
    void attachModel(dtkLogModel *model);
    void detachModel(dtkLogModel *model);
Julien Wintz's avatar
Julien Wintz committed
60

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
private:
     dtkLogger(void);
     dtkLogger(const dtkLogger& other);
    ~dtkLogger(void);

private:
    void write(const QString& message);

private:
    dtkLogger& operator=(const dtkLogger& other);

private:
    dtkLoggerPrivate *d;

private:
    friend class dtkLogEngine;
    friend class dtkLogEnginePrivate;
};

#endif