efl_mono: move Eina.Log.Init to class consturctor

Summary:
This removes the need to explicitly init the log class.
Depends on D7495

Reviewers: felipealmeida, lauromoura, segfaultxavi

Reviewed By: felipealmeida, segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7555
This commit is contained in:
Marcel Hollerbach 2019-01-16 13:47:09 +01:00 committed by Xavi Artigas
parent 4cac97675e
commit 1e2faf8527
3 changed files with 16 additions and 15 deletions

View File

@ -14,7 +14,6 @@ public class Config {
throw (new Efl.EflException("Failed to initialize Eina"));
// Initialize the submodules here
Eina.Log.Init();
Eina.Error.Init();
}

View File

@ -53,22 +53,17 @@ public class Log
private static int domain = -1;
internal static void Init(String name="mono", String color="\033[32;1m")
static Log()
{
if (domain == -1)
{
// Maybe move this check outside when other eina stuff get support?
domain = eina_log_domain_register(name, color);
if (domain < 0)
Console.WriteLine("Error: Couldn't register Eina log domain for name {0}.", name);
else
Info($"Registered mono domain with number {domain}");
}
const String name="mono";
const String color="\033[32;1m";
// Maybe move this check outside when other eina stuff get support?
domain = eina_log_domain_register(name, color);
if (domain < 0)
Console.WriteLine("Error: Couldn't register Eina log domain for name {0}.", name);
else
{
Warning("Trying to initialize the log system again.");
// TODO Export the domain registration to the binding user to allow custom domains.
}
Info($"Registered mono domain with number {domain}");
}
private static void EnsureDomainRegistered()

View File

@ -4047,5 +4047,12 @@ class TestEinaAccessor
}
}
class TestEinaLog
{
public static void basic_log_usage()
{
Eina.Log.Error("This should work");
}
}
}