Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

# Set to "true" to include gdb and perf for debugging/profiling
# Set to "true" to include gdb, perf, and valgrind for debugging/profiling
ARG INCLUDE_DEBUG_TOOLS=false

# Install runtime dependencies (and optionally profiling tools)
Expand All @@ -94,7 +94,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libstdc++6 \
zlib1g \
&& if [ "$INCLUDE_DEBUG_TOOLS" = "true" ]; then \
apt-get install -y --no-install-recommends gdb linux-tools-generic \
apt-get install -y --no-install-recommends gdb linux-tools-generic valgrind \
&& ln -sf /usr/lib/linux-tools/*/perf /usr/local/bin/perf || true; \
fi \
&& rm -rf /var/lib/apt/lists/*
Expand Down
11 changes: 7 additions & 4 deletions src/support/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,12 @@ static void format_timestamp(char buffer[32]) {
buffer[0] = '\0';
return;
}
/* Clean format: HH:MM:SS.mmm */
/* Clean format: YYYY-MM-DD HH:MM:SS.mmm */
int written = snprintf(
buffer, 32, "%02d:%02d:%02d.%03ld",
buffer, 32, "%04d-%02d-%02d %02d:%02d:%02d.%03ld",
tm_result.tm_year + 1900,
tm_result.tm_mon + 1,
tm_result.tm_mday,
tm_result.tm_hour,
tm_result.tm_min,
tm_result.tm_sec,
Expand Down Expand Up @@ -339,7 +342,7 @@ void lantern_log_log(
fprintf(
target,
"%s%s%s %s%s%s %s[%s]%s %s",
ANSI_DIM, timestamp[0] ? timestamp : "??:??:??.???", ANSI_RESET,
ANSI_DIM, timestamp[0] ? timestamp : "????-??-?? ??:??:??.???", ANSI_RESET,
level_to_color(level), level_to_string(level), ANSI_RESET,
ANSI_CYAN, component ? component : "?", ANSI_RESET,
formatted);
Expand All @@ -354,7 +357,7 @@ void lantern_log_log(
fprintf(
target,
"%s %s [%s] %s",
timestamp[0] ? timestamp : "??:??:??.???",
timestamp[0] ? timestamp : "????-??-?? ??:??:??.???",
level_to_string(level),
component ? component : "?",
formatted);
Expand Down