Browse Source

Lazy logging without header

terry-xiaoyu 7 năm trước cách đây
mục cha
commit
bc1464a33f
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      include/logger.hrl

+ 7 - 1
include/logger.hrl

@@ -14,5 +14,11 @@
         end).
 -else.
 %% without header
--define(LOG(Level, Format, Args), logger:log(Level, Format, Args)).
+-define(LOG(Level, Format, Args),
+        begin
+          (logger:log(Level,#{},#{report_cb =>
+                                    fun(_) ->
+                                        {(Format), (Args)}
+                                    end}))
+        end).
 -endif.