示例#1
0
        private static void LiteCoreLog(C4LogDomain* domain, C4LogLevel level, IntPtr message, IntPtr ignored)
        {
            // Not the best place to do this, but otherwise we have to require the developer
            // To signal us when they change the log level
            RecalculateLevel();

            var domainName = Native.c4log_getDomainName(domain);
            var logDomain = To.DomainForString(domainName);
            var actualMessage = message.ToUTF8String();
            Database.Log.Console.Log((LogLevel)level, logDomain, actualMessage);
            Database.Log.Custom?.Log((LogLevel)level, logDomain, actualMessage);
        }
示例#2
0
        private static void LiteCoreLog(C4LogDomain *domain, C4LogLevel level, string message, IntPtr ignored)
        {
            var domainName = Native.c4log_getDomainName(domain);

            foreach (var logger in To.All)
            {
                if (logger.Domain == domainName)
                {
                    logger.QuickWrite(level, message, TextLogger);
                    return;
                }
            }

            To.LiteCore.QuickWrite(level, message, TextLogger);
        }
示例#3
0
 public static extern void c4slog(C4LogDomain *domain, C4LogLevel level, FLSlice msg);
示例#4
0
 public static extern byte *c4log_getDomainName(C4LogDomain *x);
 public void c4slog(C4LogDomain *domain, C4LogLevel level, string msg) => Native.c4slog(domain, level, msg);
 public void c4log_setLevel(C4LogDomain *c4Domain, C4LogLevel level) => Native.c4log_setLevel(c4Domain, level);
 public C4LogLevel c4log_getLevel(C4LogDomain *x) => Native.c4log_getLevel(x);
示例#8
0
 public static extern void c4log_setLevel(C4LogDomain *c4Domain, C4LogLevel level);
 public byte *c4log_getDomainName(C4LogDomain *x) => NativeRaw.c4log_getDomainName(x);
 public static void c4slog(C4LogDomain *domain, C4LogLevel level, string msg) => Impl.c4slog(domain, level, msg);
 public static void c4log_setLevel(C4LogDomain *c4Domain, C4LogLevel level) => Impl.c4log_setLevel(c4Domain, level);
 public static C4LogLevel c4log_getLevel(C4LogDomain *x) => Impl.c4log_getLevel(x);
 public static string c4log_getDomainName(C4LogDomain *x) => Impl.c4log_getDomainName(x);
 public static byte *c4log_getDomainName(C4LogDomain *x) => Impl.c4log_getDomainName(x);
示例#15
0
        public static string c4log_getDomainName(C4LogDomain *x)
        {
            var retVal = NativeRaw.c4log_getDomainName(x);

            return(Marshal.PtrToStringAnsi((IntPtr)retVal));
        }
示例#16
0
 public static extern C4LogLevel c4log_getLevel(C4LogDomain *x);
 public void c4slog(C4LogDomain *domain, C4LogLevel level, C4Slice msg) => NativeRaw.c4slog(domain, level, msg);
示例#18
0
 public static void c4slog(C4LogDomain *domain, C4LogLevel level, string msg)
 {
     using (var msg_ = new C4String(msg)) {
         NativeRaw.c4slog(domain, level, msg_.AsFLSlice());
     }
 }
 public string c4log_getDomainName(C4LogDomain *x) => Native.c4log_getDomainName(x);