예제 #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 c4log_setLevel(C4LogDomain *c4Domain, C4LogLevel level);
예제 #4
0
 public static extern void c4log_setCallbackLevel(C4LogLevel level);
예제 #5
0
 public static extern void c4slog(C4LogDomain *domain, C4LogLevel level, FLSlice msg);
예제 #6
0
 private static void Log(C4LogLevel level, string message)
 {
     string[] levelNames = new[] { "debug", "info", "WARNING", "ERROR" };
     Console.Error.WriteLineAsync(String.Format("CBForest-C {0}: {1}", levelNames[(int)level], message));
 }
예제 #7
0
파일: Native.cs 프로젝트: buzzfeed/cbforest
 private static void c4log_wedge(C4LogLevel level, C4Slice message)
 {
     if (_LogCallback != null) {
         var sharpString = (string)message;
         _LogCallback(level, sharpString);
     }
 }
예제 #8
0
파일: Native.cs 프로젝트: buzzfeed/cbforest
 private static extern void c4log_register(C4LogLevel level, C4LogCallback callback);
 public static extern bool c4log_writeToBinaryFile(C4LogLevel level, FLSlice path, C4Error *error);
 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 void c4log_setBinaryFileLevel(C4LogLevel level) => Impl.c4log_setBinaryFileLevel(level);
 public static void c4log_setCallbackLevel(C4LogLevel level) => Impl.c4log_setCallbackLevel(level);
예제 #14
0
 public static extern void c4log_setLevel(C4LogLevel level);
 public static bool c4log_writeToBinaryFile(C4LogLevel level, C4Slice path, C4Error *error) => Impl.c4log_writeToBinaryFile(level, path, error);
 public static extern void c4log_register(C4LogLevel level, C4LogCallback callback);
 public bool c4log_writeToBinaryFile(C4LogLevel level, C4Slice path, C4Error *error) => NativeRaw.c4log_writeToBinaryFile(level, path, error);
 public static bool c4log_writeToBinaryFile(C4LogLevel level, string path, C4Error *error)
 {
     using (var path_ = new C4String(path)) {
         return(NativeRaw.c4log_writeToBinaryFile(level, path_.AsFLSlice(), error));
     }
 }
 public void c4slog(C4LogDomain *domain, C4LogLevel level, C4Slice msg) => NativeRaw.c4slog(domain, level, msg);
예제 #20
0
파일: Native.cs 프로젝트: buzzfeed/cbforest
        public static void c4log_register(C4LogLevel level, Action<C4LogLevel, string> callback)
        {
            _LogCallback = callback;

            // This is needed to ensure that the delegate object itself doesn't get garbage collected
            _NativeLogCallback = _LogCallback == null ? null : new C4LogCallback(c4log_wedge);
            c4log_register(level, _NativeLogCallback);
        }
 public void c4log_writeToCallback(C4LogLevel level, C4LogCallback callback, bool preformatted) => Native.c4log_writeToCallback(level, callback, preformatted);
예제 #22
0
파일: C4Test.cs 프로젝트: lordkev/cbforest
 private static void Log(C4LogLevel level, C4Slice message)
 {
     string[] levelNames = new[] { "debug", "info", "WARNING", "ERROR" };
     Console.Error.WriteLineAsync(String.Format("CBForest-C {0}: {1}", levelNames[(int)level], (string)message));
 }
 public bool c4log_writeToBinaryFile(C4LogLevel level, string path, C4Error *error) => Native.c4log_writeToBinaryFile(level, path, error);
예제 #24
0
 private void Log(C4LogLevel level, C4Slice s)
 {
     WriteLine($"[{level}] {s.CreateString()}");
 }
 public void c4log_setCallbackLevel(C4LogLevel level) => Native.c4log_setCallbackLevel(level);
예제 #26
0
 public static extern void c4log_writeToCallback(C4LogLevel level, C4LogCallback callback, [MarshalAs(UnmanagedType.U1)] bool preformatted);
 public void c4log_setBinaryFileLevel(C4LogLevel level) => Native.c4log_setBinaryFileLevel(level);
예제 #28
0
 public static extern void c4log_setBinaryFileLevel(C4LogLevel level);
 public void c4log_setLevel(C4LogDomain *c4Domain, C4LogLevel level) => Native.c4log_setLevel(c4Domain, level);
예제 #30
0
 public static void c4slog(C4LogDomain *domain, C4LogLevel level, string msg)
 {
     using (var msg_ = new C4String(msg)) {
         NativeRaw.c4slog(domain, level, msg_.AsFLSlice());
     }
 }
 public void c4slog(C4LogDomain *domain, C4LogLevel level, string msg) => Native.c4slog(domain, level, msg);