(* * This file is part of Bolt. * Copyright (C) 2009-2012 Xavier Clerc. * * Bolt is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * Bolt is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . *) (* Definitions *) type t = (string list) * (string list) * (Event.t -> string) let _, register, register_unnamed, get = Utils.make_container_functions () (* Predefined layouts *) let simple = [], [], Event.render "$(level:5) - $(message)" let default = [], [], Event.render "$(relative:-8) [$(file:-16) $(line:5)] $(level:5) - $(message)" let pattern h f p = h, f, Event.render p let style = [ "" ] let html = [ "" ; "" ; "Log" ] @ style @ [ "" ; "" ; "

" ; "" ; ("" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "" ^ "") ], [ "
IdentifierTimeMillisLevelFileMessage
" ; "

" ; ("

Generated by Bolt " ^ Version.value ^ "

") ; "" ; "" ], Event.render ("" ^ "$(id)" ^ "$(hour):$(min):$(sec)" ^ "$(relative)" ^ "$(level)" ^ "
$(filebase:-24) $(line:4)
" ^ "$(message)" ^ "") let csv sep l = let render e = let b = Event.bindings e in let values = List.map (fun k -> try List.assoc k b with _ -> "") l in String.concat sep values in ([], [], render) let () = List.iter (fun (x, y) -> register x y) [ "simple", simple ; "default", default ; "html", html ]