Skip to content

Commit

Permalink
fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwparas committed Nov 14, 2023
1 parent 04cf993 commit c7c66d6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 34 deletions.
48 changes: 16 additions & 32 deletions cogs/logging/log.scm
Original file line number Diff line number Diff line change
@@ -1,59 +1,43 @@
(require-builtin steel/time)
(require-builtin steel/strings/colors as colors.)

(provide log! log/info! log/warn! log/debug! log/error!)
(provide log!
log/info!
log/warn!
log/debug!
log/error!)

(define *info* (colors.green "INFO"))
(define *warn* (colors.yellow "WARN"))
(define *debug* (colors.blue "DEBUG"))
(define *error* (colors.red "ERROR"))
(define *trace* (colors.purple "TRACE"))

; (displayln "LOADING MODULE")

; (define (log! level target arg-list)
; (apply displayln (append
; (list
; (local-time/now! "%Y-%m-%dT%H:%M:%S")
; " ["
; level
; " "
; target
; "] - ")
; arg-list)))
(define *info* "INFO")
(define *warn* "WARN")
(define *debug* "DEBUG")
(define *error* "ERROR")
(define *trace* "TRACE")

;;@doc
;; Log directly on the specified level the with arguments, as a list
(define (log! level arg-list)
(apply displayln (append
(list
(local-time/now! "%Y-%m-%dT%H:%M:%S")
" ["
level
"] - ")
arg-list)))
(apply displayln (append (list (local-time/now! "%Y-%m-%dT%H:%M:%S") " [" level "] - ") arg-list)))

;;@doc
;; Log the arguments using the *info* target, i.e. log on INFO
(define (log/info! . args)
(log! *info* args))
(log! *info* args))

;;@doc
;; Log the arguments using the *warn* target, i.e. log on WARN
(define (log/warn! . args)
(log! *warn* args))
(log! *warn* args))

;;@doc
;; Log the arguments using the *debug* target, i.e. log on DEBUG
(define (log/debug! . args)
(log! *debug* args))
(log! *debug* args))

;;@doc
;; Log the arguments using the *error* target, i.e. log on ERROR
(define (log/error! . args)
(log! *error* args))
(log! *error* args))

;;@doc
;; Log the arguments using the *trace* target, i.e. log on TRACE
(define (log/trace! . args)
(log! *trace* args))
(log! *trace* args))
4 changes: 2 additions & 2 deletions crates/steel-core/src/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1615,12 +1615,12 @@ mod parser_tests {
#[test]
fn parse_unicode() {
assert_parse("#\\¡", &[character('¡')]);
assert_parse("#\\\\u{b}", &[character('\u{b}')]);
assert_parse("#\\u{b}", &[character('\u{b}')]);
}

#[test]
fn parse_more_unicode() {
assert_parse("#\\\\u{a0}", &[character('\u{a0}')]);
assert_parse("#\\u{a0}", &[character('\u{a0}')]);
}

#[test]
Expand Down

0 comments on commit c7c66d6

Please sign in to comment.