Просмотр исходного кода

ncd: NCDModule: implement NCDModuleInst_Backend_LogContext()

ambrop7 13 лет назад
Родитель
Сommit
480d94d9dd
2 измененных файлов с 12 добавлено и 0 удалено
  1. 7 0
      ncd/NCDModule.c
  2. 5 0
      ncd/NCDModule.h

+ 7 - 0
ncd/NCDModule.c

@@ -326,6 +326,13 @@ void NCDModuleInst_Backend_LogVarArg (NCDModuleInst *n, int channel, int level,
     BLog_LogViaFuncVarArg(n->params->logfunc, n, channel, level, fmt, vl);
 }
 
+BLogContext NCDModuleInst_Backend_LogContext (NCDModuleInst *n)
+{
+    DebugObject_Access(&n->d_obj);
+    
+    return BLog_MakeContext(n->params->logfunc, n);
+}
+
 void NCDModuleInst_Backend_InterpExit (NCDModuleInst *n, int exit_code)
 {
     DebugObject_Access(&n->d_obj);

+ 5 - 0
ncd/NCDModule.h

@@ -571,6 +571,11 @@ void NCDModuleInst_Backend_Log (NCDModuleInst *n, int channel, int level, const
  */
 void NCDModuleInst_Backend_LogVarArg (NCDModuleInst *n, int channel, int level, const char *fmt, va_list vl);
 
+/**
+ * Returns a logging context. The context is valid until the backend dies.
+ */
+BLogContext NCDModuleInst_Backend_LogContext (NCDModuleInst *n);
+
 /**
  * Initiates interpreter termination.
  *