From owner-freebsd-hackers@freebsd.org Sun Dec 10 09:00:44 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94C22E86B25 for ; Sun, 10 Dec 2017 09:00:44 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 612306950D for ; Sun, 10 Dec 2017 09:00:42 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-qk0-x235.google.com with SMTP id h19so3726965qkj.11 for ; Sun, 10 Dec 2017 01:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NTVW4lxbjBbyYiQE9qEKi8Wl+3u9voBslW7XDhohK0E=; b=f5tK5m225viGDyQVCP87FXBSVnyZf1IX/iycK74ypGTFEQZzytxk75Y7bCt6N0HcS4 Ws+OSCe8i0M5FfZSI7yjBzgfuaDN0sjBFfICABkkAGvmzFR2tWys6UYT7prb+LPMErvK WKnm9ZeIhLgjv5V+T0gvGnl91M4EUika2DjcLa3+pDCSiUe28YQRgMohU1v/dLpuIhE/ 8FUl0zDzjI3Re7vRG+a04BvaiCU9buUc9Z/mh7cdMebGTMSdBBWfvxji8ofl+vUP4cjF YRORaW/EbT2osV3qTfyNoamWHfSueXSCRBaAoxty7wSrmKP9SIQBgz5727aKWnYmbcKN FN9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NTVW4lxbjBbyYiQE9qEKi8Wl+3u9voBslW7XDhohK0E=; b=E+2oJlW1FV0MLWHOlo6GxaTC+WnshvOux2WhRUv9oZdVKHkaBMzaVuOdBmKhx7gnOd OC9oiLTej3e3VU/vR3BnaUQDrLM29B9r0aTwlxpp8K3Js+e06UqhBStUagmhTuBjfDPB 073tul9CIwetOjKxHYgRAwLllIdk/bw1I3v5zRPrs4PhgCG0N38DwjFdry/Z4LlyvW38 vJeqUeR6LtBf34PQ2F4V38Q/08Kw6EY7zUNWZYAg61qz08itlYZS/Pskw93qQdsuVkja U6lcADmKpReN9ZUUbhCpm85sAs/GkUcgTcn54iV+Z1SWQ0/Y9Rwc9fCD4ok7eyaChBmy j0cA== X-Gm-Message-State: AKGB3mIQPJoSRd2echhDl3wr0Izju1hUCWXM2L81nFu5bIjk9R34QRIb cvN4ePSBkiE4N6K8vDgjphrzeO3xYkoo2rOwC+jbjA== X-Google-Smtp-Source: AGs4zMYN3MStQkNML5AfLLUWZPjF8ISo70qU731iZH5vQF6F3AO77Ak6WyqJ/jl04u6kWjfASIdvh8n0m7W8HLGjwrA= X-Received: by 10.55.104.198 with SMTP id d189mr41806281qkc.190.1512896441918; Sun, 10 Dec 2017 01:00:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.89.244 with HTTP; Sun, 10 Dec 2017 01:00:41 -0800 (PST) Received: by 10.140.89.244 with HTTP; Sun, 10 Dec 2017 01:00:41 -0800 (PST) In-Reply-To: <0dd5240f-6c70-425f-7e98-7946097ea3ef@metricspace.net> References: <0dd5240f-6c70-425f-7e98-7946097ea3ef@metricspace.net> From: Michael Zhilin Date: Sun, 10 Dec 2017 12:00:41 +0300 Message-ID: Subject: Re: Hopefully useful: macro-controlled logger To: Eric McCorkle Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Dec 2017 09:00:44 -0000 Hi Eric! Nice! This minimalistic and powerful approach looks very nice. We have similar thing in one of kernel driver: https://github.com/freebsd/freebsd/blob/master/sys/dev/bhnd/bhnd_debug.h In my opinion such kind of thing is demanded. Best regards, Michael. 9 =D0=B4=D0=B5=D0=BA. 2017 =D0=B3. 7:52 =D0=9F=D0=9F =D0=BF=D0=BE=D0=BB=D1= =8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C "Eric McCorkle" =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > Hi folks, > > At some point in the past, I recall reading about a log4j-inspired > logging API for C that used the preprocessor to avoid introducing > runtime overhead. However, I've never been able to find this library, > so I've used my own scrappy macro collection over the years. > > Anyway, on a recent flight I decided to implement a macro-controlled > logging API in earnest. > > The github project can be found here: https://github.com/emc2/mcl > > It provides the ability to define module-specific loggers, log at > different levels, and set a threshold for dynamically-controlled logging > levels. Any log message more severe than the dynamic range will be > hardwired in place, and any message less severe will be removed at > compilation time. > > It's not large or complicated at all, but hopefully someone will find it > useful. If they do, I'd be more than happy to have it added to the > FreeBSD base system. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " >