Code Review
/
sim
/
o1-interface.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add NF addressing method as ENV.
[sim/o1-interface.git]
/
ntsimulator
/
ntsim-ng
/
utils
/
log_utils.c
diff --git
a/ntsimulator/ntsim-ng/utils/log_utils.c
b/ntsimulator/ntsim-ng/utils/log_utils.c
index
b0e26af
..
006ee46
100644
(file)
--- a/
ntsimulator/ntsim-ng/utils/log_utils.c
+++ b/
ntsimulator/ntsim-ng/utils/log_utils.c
@@
-37,6
+37,10
@@
static int instances = 0;
static FILE* logfile = 0;
static int instances = 0;
static FILE* logfile = 0;
+static int file_no = 0;
+static int line_no = 0;
+static const char *filename;
+
static char *extract_format(const char *format);
void log_init(const char *logfilename) {
static char *extract_format(const char *format);
void log_init(const char *logfilename) {
@@
-46,9
+50,24
@@
void log_init(const char *logfilename) {
logfile = fopen(logfilename, "w");
assert(logfile);
logfile = fopen(logfilename, "w");
assert(logfile);
+ file_no = 0;
+ line_no = 0;
+ filename = logfilename;
}
void log__message(char const * const fname, uint32_t location, int verbose_level, const char *format, ...) {
}
void log__message(char const * const fname, uint32_t location, int verbose_level, const char *format, ...) {
+ if(verbose_level >= 0) {
+ line_no++;
+ if(line_no >= 5000) {
+ fclose(logfile);
+
+ file_no++;
+ char logfilename[512];
+ sprintf(logfilename, "%s.%d", filename, file_no);
+ logfile = fopen(logfilename, "w");
+ line_no = 0;
+ }
+ }
va_list arg;
va_list arg;