Make logs optional

milestone_5_without_improvements-logs
chortas 4 years ago
parent 14c8458474
commit 5914f9dd07

@ -20,6 +20,7 @@
* IN THE SOFTWARE.
*/
#include <stdlib.h>
#include "log.h"
#define MAX_CALLBACKS 32
@ -145,6 +146,9 @@ void log_log(int level, const char *file, int line, const char *fmt, ...) {
.level = level,
};
char* env_var = getenv("ENV");
if (strcmp("false", env_var) == 0) return;
lock();
if (!L.quiet && level >= L.level) {

@ -1 +1 @@
python3 test.py 2>&1 | tee log.txt
ENV=false python3 test.py 2>&1 | tee log_$1.txt

@ -28,6 +28,6 @@ variance=3.5682389
typ=3
k=gen(nx, ny, nz, dx, dy, dz, seed, variograms, mean, variance, typ, 8)
np.save(f"out_{0}.npy",k)
np.save(f"out_{N}.npy",k)
del k
gc.collect()
Loading…
Cancel
Save