From 97040aaf30d74d1c957d82a1b164d5011e6bfe36 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Thu, 19 Sep 2024 11:00:43 -0400 Subject: [PATCH] minor: Specially format sprocs in info/1 output --- src/khepri_utils.erl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/khepri_utils.erl b/src/khepri_utils.erl index fb0f978d..659f19d2 100644 --- a/src/khepri_utils.erl +++ b/src/khepri_utils.erl @@ -12,6 +12,8 @@ -include_lib("stdlib/include/assert.hrl"). +-include_lib("horus/include/horus.hrl"). + -include("include/khepri.hrl"). -include("src/khepri_error.hrl"). @@ -226,6 +228,9 @@ data_prefix(#{child_nodes := _}, _Options) -> "│ "; data_prefix(_, #{lines := false}) -> " "; data_prefix(_, _Options) -> " ". +format_data(SProc, _Options) when ?IS_HORUS_FUN(SProc) -> + Fun = horus:to_fun(SProc), + lists:flatten(io_lib:format("SProc: ~tp", [Fun])); format_data(Data, _Options) -> lists:flatten(io_lib:format("Data: ~tp", [Data])).