Skip to content

Commit

Permalink
Some logging updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tonycurtis committed Jun 17, 2022
1 parent 5abcf9c commit dde70fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/shmemu/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,15 @@ parse_log_events(void)
void
shmemu_logger_init(void)
{
double wd;

if (! proc.env.logging) {
return;
}

/* TODO "%" modifiers for extra info */
if (proc.env.logging_file != NULL) {
log_stream = fopen(proc.env.logging_file, "a");
log_stream = fopen(proc.env.logging_file, "w");
if (log_stream == NULL) {
shmemu_fatal(MODULE ": can't append to log file \"%s\"",
shmemu_fatal(MODULE ": can't write to log file \"%s\"",
proc.env.logging_file);
/* NOT REACHED */
}
Expand All @@ -117,8 +115,7 @@ shmemu_logger_init(void)
}

/* how wide to display things */
wd = ceil(log10((double) proc.li.nranks));
pe_width = (int) wd;
pe_width = (int) ceil(log10((double) proc.li.nranks));
stamp_width = 30 - pe_width;
if (stamp_width < 1) {
stamp_width = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/shmemu/shmemu.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void shmemu_deprecate(const char *fn, const shmemu_version_t *vp);
#endif /* ENABLE_LOGGING */

/*
* translate between tread levels and their names
* translate between thread levels and their names
*/

const char *shmemu_thread_name(int tl);
Expand Down

0 comments on commit dde70fa

Please sign in to comment.