Improved logging system

This commit is contained in:
Thulinma 2017-12-05 16:09:14 +01:00
parent 71477f05d3
commit 08dac5b2db
12 changed files with 190 additions and 50 deletions

View file

@ -7,9 +7,11 @@
#include <mist/amf.h>
#include <mist/config.h>
#include <mist/defines.h>
#include <mist/util.h>
#include <string>
int main(int argc, char **argv){
Util::redirectLogsIfNeeded();
Util::Config conf(argv[0]);
JSON::Value opt;
opt["arg_num"] = 1ll;

View file

@ -7,6 +7,7 @@
#include <mist/downloader.h>
#include <mist/timing.h>
#include <mist/tinythread.h>
#include <mist/util.h>
#include <set>
#include <string>
@ -587,6 +588,7 @@ void handleServer(void *hostEntryPointer){
}
int main(int argc, char **argv){
Util::redirectLogsIfNeeded();
memset(hosts, 0, sizeof(hosts)); // zero-fill the hosts list
Util::Config conf(argv[0]);
cfg = &conf;

View file

@ -3,6 +3,7 @@
#include <mist/shared_memory.h>
int main(int argc, char ** argv){
Util::redirectLogsIfNeeded();
if (argc < 1){
FAIL_MSG("Usage: %s MEMORY_PAGE_NAME");
return 1;

View file

@ -9,6 +9,7 @@
#include <mist/config.h>
#include <mist/defines.h>
#include <mist/socket.h>
#include <mist/util.h>
void printStatistics(char * data, size_t len, unsigned int id){
@ -32,6 +33,7 @@ void printStatistics(char * data, size_t len, unsigned int id){
/// Will emulate a given amount of clients in the statistics.
int main(int argc, char ** argv){
Util::redirectLogsIfNeeded();
Util::Config conf = Util::Config(argv[0]);
conf.addOption("clients", JSON::fromString("{\"arg\":\"num\", \"short\":\"c\", \"long\":\"clients\", \"default\":1000, \"help\":\"Amount of clients to emulate.\"}"));
conf.addOption("stream", JSON::fromString("{\"arg\":\"string\", \"short\":\"s\", \"long\":\"stream\", \"default\":\"test\", \"help\":\"Streamname to pretend to request.\"}"));