Skip to content

Commit

Permalink
fix bugs of logging and C APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
masajiro committed Nov 6, 2019
1 parent d21a8c2 commit dcd3bd7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.0
1.8.1
6 changes: 3 additions & 3 deletions lib/NGT/Capi.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ const char *ngt_get_error_string(const NGTError);
void ngt_clear_error_string(NGTError);

void ngt_destroy_error_object(NGTError);
NGTOptimizer ngt_create_optimizer(NGTError);

NGTOptimizer ngt_create_optimizer(bool logDisabled, NGTError);

bool ngt_optimizer_adjust_search_coefficients(NGTOptimizer, const char *, NGTError);

Expand All @@ -146,7 +146,7 @@ bool ngt_optimizer_execute(NGTOptimizer, const char *, const char *, NGTError);
bool ngt_optimizer_set(NGTOptimizer optimizer, int outgoing, int incoming, int nofqs,
float baseAccuracyFrom, float baseAccuracyTo,
float rateAccuracyFrom, float rateAccuracyTo,
double qte, double m, int log, NGTError error);
double qte, double m, NGTError error);

void ngt_destroy_optimizer(NGTOptimizer);

Expand Down
6 changes: 3 additions & 3 deletions lib/NGT/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ namespace NGT {
if (!enabled) {
return;
}
if (logFilePath != "/dev/null") {
logFD = open("log", O_WRONLY|O_APPEND, mode);
if (logFilePath == "/dev/null") {
logFD = open(logFilePath.c_str(), O_WRONLY|O_APPEND, mode);
} else {
logFD = open("log", O_CREAT|O_WRONLY|O_APPEND, mode);
logFD = open(logFilePath.c_str(), O_CREAT|O_WRONLY|O_APPEND, mode);
}
if (logFD < 0) {
std::cerr << "Logger: Cannot begin logging." << std::endl;
Expand Down

0 comments on commit dcd3bd7

Please sign in to comment.