Skip to content

Commit

Permalink
Update for logging v2.1
Browse files Browse the repository at this point in the history
log-info et al don't take a <log> argument since v2.0.
  • Loading branch information
cgay committed Aug 28, 2021
1 parent d8cf649 commit 97c789f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions server/core/utilities.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ define thread variable *error-log* :: <log> = $default-log;

define thread variable *request-log* :: <log> = $default-log;

define constant log-trace = curry(%log-trace, *debug-log*);
define constant log-debug = curry(%log-debug, *debug-log*);
define constant log-info = curry(%log-info, *debug-log*);
define constant log-warning = curry(%log-warning, *error-log*);
define constant log-error = curry(%log-error, *error-log*);
//apply(log-message, $trace-level, *log*, object, args);

define constant log-trace = curry(log-message, $trace-level, *debug-log*);
define constant log-debug = curry(log-message, $debug-level, *debug-log*);
define constant log-info = curry(log-message, $info-level, *debug-log*);
define constant log-warning = curry(log-message, $warn-level, *error-log*);
define constant log-error = curry(log-message, $error-level, *error-log*);

// For debugging only.
// For logging request and response content data only.
Expand All @@ -75,7 +77,9 @@ define variable *content-log* :: <log>
define variable *log-content?* :: <boolean> = #f;

define inline method log-content (content)
log-debug-if(*log-content?*, *content-log*, "Sent content: %=", content);
if (*log-content?*)
log-message($debug-level, *content-log*, "Sent content: %=", content);
end;
end;

define class <multi-log-mixin> (<object>)
Expand Down

0 comments on commit 97c789f

Please sign in to comment.