Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Log.vala « src « libdecsync « decsync « backend « plugins - github.com/jangernert/FeedReader.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 906ecdd0ce48f967c10602d057e68343040a2454 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* libdecsync-vala - Log.vala
*
* Copyright (C) 2018 Aldo Gunsing
*
* This library 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.
*
* This library 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 General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, see <http://www.gnu.org/licenses/>.
*/

public class Log : GLib.Object {
	const string TAG = "DecSync";

	private static void log(LogLevelFlags level, string message)
	{
		GLib.log_structured(TAG, level, "MESSAGE", "%s", message);
	}

	public static void e(string message)
	{
		log(GLib.LogLevelFlags.LEVEL_CRITICAL, message);
	}

	public static void w(string message)
	{
		log(GLib.LogLevelFlags.LEVEL_WARNING, message);
	}

	public static void i(string message)
	{
		log(GLib.LogLevelFlags.LEVEL_INFO, message);
	}

	public static void d(string message)
	{
		log(GLib.LogLevelFlags.LEVEL_DEBUG, message);
	}
}