forked from Neo-ZK/ImageServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (29 loc) · 828 Bytes
/
main.cpp
File metadata and controls
37 lines (29 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <stdio.h>
#include "thread/CurrentThread.h"
#include "thread/Mutex.h"
#include "log/LogFile.h"
#include "log/Logger.h"
#include "log/AsyncLogger.h"
#include "server/ImageServer.h"
#include <unistd.h>
#include <sys/time.h>
using namespace std;
ZK_ImageServer::AsyncLogger* g_AsyncLogger = NULL;
void testOutput(const char* line,int len)
{
g_AsyncLogger->append(line,len);
}
int main()
{
ZK_ImageServer::Logger::setOutputFun(testOutput);
//ZK_ImageServer::LogFile output(__FILE__,10000000);
ZK_ImageServer::AsyncLogger asynlogger(__FILE__,1000000);
g_AsyncLogger = &asynlogger;
g_AsyncLogger->start();
//out = &output;
ZK_ImageServer::net::EventLoop baseLoop;
ZK_ImageServer::server::ImageServer imageServer(&baseLoop);
baseLoop.loop();
return 0;
}