# HG changeset patch # User Matthew Wild # Date 1240344672 -3600 # Node ID efd71cae24ea796212f6afeb032604033bedc8cb # Parent c0a3ef0a1f34248258d8a7d3ca54ba831ffd6cda# Parent 1bcc8ca57a7c715cfb01cf69897339790a4fca22 Merge with 0.4.1 diff -r c0a3ef0a1f34 -r efd71cae24ea core/loggingmanager.lua --- a/core/loggingmanager.lua Wed Apr 22 00:49:45 2009 +0500 +++ b/core/loggingmanager.lua Tue Apr 21 21:11:12 2009 +0100 @@ -8,12 +8,15 @@ local logger = require "util.logger"; +local default_logging = { { to = "console" } }; + -- Global log function, because some people are too -- lazy to get their own... _G.log = logger.init("general"); local log_sink_types = {}; local get_levels; +local logging_levels = { "debug", "info", "warn", "error", "critical" } --- Main function to read config, create the appropriate sinks and tell logger module function setup_logging(log) @@ -47,7 +50,14 @@ end end); else - -- All sources + -- All sources + -- Create sink + local sink = sink_maker(sink_config); + + -- Set sink for all levels + for _, level in pairs(logging_levels) do + logger.add_level_sink(level, sink); + end end else -- No such sink type @@ -129,8 +139,6 @@ end --- Helper function to get a set of levels given a "criteria" table -local logging_levels = { "debug", "info", "warn", "error", "critical" } - function get_levels(criteria, set) set = set or {}; if type(criteria) == "string" then