{"id":24870981,"url":"https://github.com/pepzer/shrimp-log","last_synced_at":"2026-04-14T23:33:34.959Z","repository":{"id":89694514,"uuid":"108662297","full_name":"pepzer/shrimp-log","owner":"pepzer","description":"A tiny ClojureScript logging library for Node.js.","archived":false,"fork":false,"pushed_at":"2017-11-02T11:15:59.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-21T12:52:54.945Z","etag":null,"topics":["clojure","clojurescript","javascript","logging","lumo","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pepzer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-28T15:49:59.000Z","updated_at":"2017-10-28T15:57:09.000Z","dependencies_parsed_at":"2023-06-25T23:06:34.552Z","dependency_job_id":null,"html_url":"https://github.com/pepzer/shrimp-log","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pepzer/shrimp-log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepzer%2Fshrimp-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepzer%2Fshrimp-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepzer%2Fshrimp-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepzer%2Fshrimp-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pepzer","download_url":"https://codeload.github.com/pepzer/shrimp-log/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepzer%2Fshrimp-log/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31819810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","clojurescript","javascript","logging","lumo","nodejs"],"created_at":"2025-02-01T04:18:55.511Z","updated_at":"2026-04-14T23:33:34.938Z","avatar_url":"https://github.com/pepzer.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nShrimp-Log is small [ClojureScript](https://clojurescript.org/) logging library.  \nIt requires [Node.js](https://nodejs.org/en/) and is built on top of [Shrimp](https://github.com/pepzer/shrimp) and [Red Lobster](https://github.com/whamtet/redlobster).  \nAnyone looking for a mature logging library full of features should look elsewhere (e.g. [Timbre](https://github.com/ptaoussanis/timbre)).  \nThe idea behind Shrimp-Log is to have a lightweight library with enough features for small projects on [Lumo](https://github.com/anmonteiro/lumo).  \n\n## Leiningen/Clojars/Lumo\n\n[![Clojars Project](https://img.shields.io/clojars/v/shrimp-log.svg)](https://clojars.org/shrimp-log)\n\nIf you use [Leiningen](https://github.com/technomancy/leiningen) add shrimp-log to the dependencies in your `project.clj` file.\n\n```clojure\n:dependencies [... \n               [shrimp-log \"0.1.0-SNAPSHOT\"]]\n```\n    \nFor Lumo you could download the dependencies with Leiningen/Maven and specify the libraries on the CLI this way:\n\n    $ lumo -D org.clojars.pepzer/redlobster:0.2.2,shrimp:0.1.1-SNAPSHOT,shrimp-log:0.1.0-SNAPSHOT\n\n## REPL\n\nTo run a REPL you could either use `lein figwheel` (optionally with rlwrap):\n   \n    $ rlwrap lein figwheel\n\nWith Node.js and npm installed open a shell, navigate to the root of the project and run:\n\n    $ npm install ws\n    $ node target/out/shrimp-log.js\n\nThen the REPL should connect in the `lein figwheel` window.\n\nWith Lumo installed just run the `lumo-repl.cljsh` script:\n   \n    $ bash lumo-repl.cljsh\n    \nThis will run the REPL and will also listen on the port `12345` and host `localhost` for connections.  \nYou could connect with Emacs and Clojure Minor Mode.\n\n## Usage\n\nTo use the library require core and desired macros:\n \n```clojure\n(require '[shrimp-log.core :refer [trace* debug* info* warn* error* spy*]])\n(use-macros '[shrimp-log.macros :only [trace debug info warn error spy]])\n\n(trace \"test trace %d\" 1)\n\n;; =\u003e 2017-10-27T20:35:24.135Z - TRACE [cljs.user] - test trace 1\n\n(trace* \"readme\" \"test trace %d\" 2)\n\n;; =\u003e 2017-10-27T20:35:27.221Z - TRACE [readme] - test trace 2\n```\n\nAll logging methods in shrimp-log have two variants, a macro and a function (that ends with `*`). A call to `trace`, `debug`, `info`, `warn` and `error` only requires one argument, a message, that supports the format syntax and could be followed by any number of additional arguments.  \nThe functions `trace*`, `debug*`, `info*`, `warn*`and `error*` require a tag as first argument, it could be anything, it's converted to string and the only \"special\" value is the qualified keyword `::-` that gets converted to just the namespace.\n    \n```clojure\n(let [r (range 10)]\n  (info* ::- \"count is %d\" (count r)))\n  \n;; =\u003e 2017-10-27T20:47:44.935Z - INFO [cljs.user] - count is 10\n```\n\n`error`/`error*` by default behave like the others, but the setting `throw-on-err?` could be enabled to cause a throw after the log.  \n`spy` wraps an expression and logs the result besides returning it. The first argument to `spy` must be the log level, for the functions `spy*` a tag is required as second argument before the expression. Pretty printing for the logged value is enabled by default and could be controlled through the `pretty-print?` setting.\n\n```clojure\n(spy :debug (range 10))\n\n;; =\u003e 2017-10-27T21:01:27.691Z - DEBUG [cljs.user] - \n;; =\u003e (0 1 2 3 4 5 6 7 8 9)\n\n(spy* :info ::spy (reduce #(assoc %1 %2 %1) {} (range 4)))\n\n;; =\u003e ...\n;; =\u003e 2017-10-27T21:00:13.365Z - INFO [:cljs.user/spy] - \n;; =\u003e {0 {},\n;; =\u003e  1 {0 {}}, \n;; =\u003e  2 {0 {}, 1 {0 {}}}, \n;; =\u003e  3 {0 {}, 1 {0 {}}, 2 {0 {}, 1 {0 {}}}}}\n\n```\n\n## Settings\n\nSettings could be modified either by calling the method `set-opts!` with key-value pairs:\n\n```clojure\n(require '[shrimp-log.core :as l])\n\n(l/set-opts! :buffer-size 100\n             :out-file :log-file\n             :pretty-print false)\n```\n\nOr by creating a file in the current working directory called `shrimp-log.clj` and containing a Clojure map:\n\n```clojure\n;; shrimp-log.clj\n\n{:buffer-size 100\n :pretty-print? false\n :throw-on-err? true\n :log-level :warn}\n```\n\nCurrent available settings are the following:\n\n### :log-level\n\nThis defines what logs are allowed, by default all levels are printed so this value is set to `:trace`. Possible values are `:trace`, `:debug`, `:info`, `warn`, `:error` and `:none`.\n\n### :out-file\n\nCurrently the logger could only print to screen or to a file. This setting specifies the filename of the log file, there are two special keywords that could be used instead of a filename:\n\n- `:stdout` which is the default and means that messages are printed on the console,\n- `:log-file` that will cause the creation of a log file with the same name of the current folder and extension `.log`.\n\n### :pretty-print?\n\nA boolean flag to enable/disable pretty printing for `spy`/`spy*`, defaults to `true`.\n\n### :throw-on-err?\n\nA boolean flag, when `true` an error is thrown when calling `error`/`error*` after the log has been printed, but only if the log level is not equal to `:none`.   \nThe throw is asynchronous and couldn't be handled with a try/catch. This setting should be enabled only if the intended behaviour for an error message is to force the application to exit. Defaults to `false`.\n\n### :tstamp-format\n\nThis setting allows to change the format of the timestamp for logs, supported values are:\n\n* `:iso` - ISO date string format, the default,\n* `:utc` - UTC date string format,\n* `:locale` - locale date string format,\n* `:date` - only the date,\n* `:time` - only the time,\n* `:locale-date` - only the date (locale format).\n* `:locale-time` - only the time (locale format).\n\n### :buffer-size\n\nThis controls the dimension of the buffer for the log channel where all logs are sent before de-queue and print, any non-negative integer is allowed and it defaults to `1024`.   \nIf the buffer is full subsequent log messages will be silently dropped, hence this setting should be modified accordingly to the rate log messages are produced.\n\n### :log-delay\n\nThis value in milliseconds defines the amount of time the logger will pause between two subsequent prints. `:log-delay` limits the rate of logging, an high value could cause the buffer to be filled hence `:buffer-size` should be modified accordingly. The default value for `:log-delay` is 10 milliseconds.\n\n## Tests\n\nTo run the tests with Leiningen use:\n\n```\n$ lein cljsbuild test\n```\n\nWith Lumo:\n\n```\n$ bash lumo-test.sh\n```\n\n## Code Maturity\n\nThis is an early release, bugs should be expected and future releases could break the current API.\n\n## Contacts\n\n[Giuseppe Zerbo](https://github.com/pepzer), [giuseppe (dot) zerbo (at) gmail (dot) com](mailto:giuseppe.zerbo@gmail.com).\n\n## License\n\nCopyright © 2017 Giuseppe Zerbo.  \nDistributed under the [Mozilla Public License, v. 2.0](http://mozilla.org/MPL/2.0/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepzer%2Fshrimp-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpepzer%2Fshrimp-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepzer%2Fshrimp-log/lists"}