drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
file.h
1/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright 2011 Daniel Nichter
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include <iostream>
21#include <fstream>
22#include "event.h"
23
34class QueryLoggerFile
35{
36public:
37 QueryLoggerFile();
38 ~QueryLoggerFile();
39
54 bool logEvent(const event_t *event);
55
72 bool openLogFile(const char *file);
73
85 bool closeLogFile();
86
87private:
88 int _fd;
89};
bool openLogFile(const char *file)
Open new log file, close old log file if successful.
Definition file.cc:82
bool closeLogFile()
Close the log file.
Definition file.cc:97
int _fd
File handle for open log file.
Definition file.h:88
bool logEvent(const event_t *event)
Format and write the event to the log file.
Definition file.cc:43
Defines the event_t struct that encapsulates an event.