* add ffclj to libraries list * add simple logger macro to examples * add a missing link on projects page
This commit is contained in:
parent
39e17f149b
commit
5430fee1fd
3 changed files with 26 additions and 0 deletions
|
|
@ -43,6 +43,7 @@ The following libraries and projects are known to work with babashka.
|
|||
- [slingshot](#slingshot)
|
||||
- [hasch](#hasch)
|
||||
- [crispin](#crispin)
|
||||
- [ffclj](#ffclj)
|
||||
- [Pods](#pods)
|
||||
- [Projects](#projects-1)
|
||||
- [babashka-test-action](#babashka-test-action)
|
||||
|
|
@ -628,6 +629,10 @@ FOO=1 script.clj
|
|||
"1"
|
||||
```
|
||||
|
||||
### [ffclj](https://github.com/luissantos/ffclj)
|
||||
|
||||
A wrapper around executing `ffmpeg` and `ffprobe`. Supports progress reporting via core.async channels.
|
||||
|
||||
## Pods
|
||||
|
||||
[Babashka pods](https://github.com/babashka/babashka.pods) are programs that can
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
- [normalize-keywords.clj](#normalize-keywordsclj)
|
||||
- [Check stdin for data](#check-stdin-for-data)
|
||||
- [Using org.clojure/data.xml](#using-orgclojuredataxml)
|
||||
- [Simple logger](#simple-logger)
|
||||
|
||||
Here's a gallery of useful examples. Do you have a useful example? PR welcome!
|
||||
|
||||
|
|
@ -512,3 +513,12 @@ in use.
|
|||
$ bb examples/xml-example.clj
|
||||
... some vaguely interesting XML manipulation output
|
||||
```
|
||||
|
||||
## Simple logger
|
||||
|
||||
[logger.clj](logger.clj) is a simple logger that works in bb.
|
||||
|
||||
``` clojure
|
||||
$ bb "(require 'logger) (logger/log \"the logger says hi\")"
|
||||
<expr>:1:19 the logger says hi
|
||||
```
|
||||
|
|
|
|||
11
examples/logger.clj
Normal file
11
examples/logger.clj
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(ns logger)
|
||||
|
||||
(defmacro log [& msgs]
|
||||
(let [m (meta &form)
|
||||
_ns (ns-name *ns*) ;; can also be used for logging
|
||||
file *file*]
|
||||
`(binding [*out* *err*] ;; or bind to (io/writer log-file)
|
||||
(println (str ~file ":"
|
||||
~(:line m) ":"
|
||||
~(:column m))
|
||||
~@msgs))))
|
||||
Loading…
Reference in a new issue