Sfoglia il codice sorgente

Lazy logging without header

terry-xiaoyu 7 anni fa
parent
commit
bc1464a33f
1 ha cambiato i file con 7 aggiunte e 1 eliminazioni
  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.