Skip to content

Commit

Permalink
options.logging removed
Browse files Browse the repository at this point in the history
Die Option ist eigentlich unnötig und verursachte Verwirrung.
  • Loading branch information
Daniel Lauckner committed Jan 19, 2017
1 parent 27408d7 commit 733b69f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
8 changes: 2 additions & 6 deletions src/MeterMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,8 @@ void MeterMap::start() {

print(log_debug, "Meter is opened. Starting channels.", _meter->name());
for (iterator it = _channels.begin(); it!=_channels.end(); it++) {

if (options.logging()) {
(*it)->start(*it);
print(log_debug, "Logging thread started", (*it)->name());
} else
print(log_debug, "Logging thread not started", (*it)->name());
(*it)->start(*it);
print(log_debug, "Logging thread started", (*it)->name());
}
_thread_running = true;
} else {
Expand Down
9 changes: 2 additions & 7 deletions src/threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,13 @@ void * reading_thread(void *arg) {
//print(log_debug, "Buffer dump (size=%i): %s", (*ch)->name(),
//(*ch)->size(), (*ch)->dump().c_str());
}

// if logging is not enabled we need to empty the ch->buffer here already:
if (!options.logging()) {
(*ch)->buffer()->clean(false);
}
}

if (mtr->interval() > 0) {
print(log_info, "Next reading in %i seconds", mtr->name(), mtr->interval());
sleep(mtr->interval());
}
} while (options.daemon() || options.local() || options.logging() );
} while (options.daemon() || options.local());
} catch (std::exception &e) {
std::stringstream oss;
oss << e.what();
Expand Down Expand Up @@ -198,7 +193,7 @@ void * logging_thread(void *arg) { // get's started from Channel::start and stop
print(log_error, "Logging thread failed due to: %s", ch->name(), e.what());
}

} while (options.logging());
} while (true); //endless?!

print(log_debug, "Stopped logging. (daemon=%d)", ch->name(), options.daemon());
pthread_exit(0);
Expand Down
3 changes: 0 additions & 3 deletions src/vzlogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,6 @@ int main(int argc, char *argv[]) {
return (0);
}

// only logging to file if daemonizing
options.logging(options.daemon());

print(log_debug, "daemon=%d, local=%d", "main", options.daemon(), options.local());

if (options.daemon()) {
Expand Down

0 comments on commit 733b69f

Please sign in to comment.