This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-25
Channels
- # adventofcode (16)
- # babashka (8)
- # beginners (13)
- # calva (22)
- # clj-on-windows (20)
- # clojure (49)
- # clojure-australia (1)
- # clojure-europe (6)
- # clojure-nl (2)
- # clojure-uk (3)
- # clojurescript (4)
- # emacs (1)
- # fulcro (20)
- # introduce-yourself (2)
- # java (2)
- # missionary (2)
- # off-topic (10)
- # other-languages (2)
- # pathom (4)
- # re-frame (15)
Hey. I’m new to Babashka. I have successfully installed it on my Raspberry Pi and managed to run basic scripts. Now I want logging and I haven’t figured out how to log to a file.
@UGDTSFM4M Welcome! taoensso.timbre is a built-in dependency so you shouldn't have to include the dep. But we didn't expose the appenders namespace in babashka. spit-appender is also available in the taoensso.timbre
namespace
Thanks x 2! I see, I'll try that when I'm at the computer.
(ns my-project.log
(:require [taoensso.timbre :as timbre]
[taoensso.timbre.appenders.core :as appenders]))
(timbre/merge-config!
{:appenders {:spit (appenders/spit-appender {:fname "/path/my-file.log"})}})
bb.edn contains
:deps {
com.taoensso/timbre {:mvn/version "5.1.2"}}
I get the following error
> ----- Error -------------------------------------------------------------------- > Type: clojure.lang.ExceptionInfo > Message: Could not resolve symbol: clojure-version > Location: clojure/tools/reader/impl/utils.clj:17:35 > Phase: analysis > > ----- Context ------------------------------------------------------------------ > 13: (when x > 14: (clojure.core/char x))) > 15: > 16: (def <=clojure-1-7-alpha5 > 17: (let [{:keys [minor qualifier]} clojure-version] > ^--- Could not resolve symbol: clojure-version > 18: (or (< minor 7) > 19: (and (= minor 7) > 20: (= “alpha” > 21: (when qualifier > 22: (subs qualifier 0 (dec (count qualifier)))))