GST_DEBUG:如何保存日志在一个单独的文件中一个线程的应用程序内 [英] GST_DEBUG: How to save logs in a separate file for a thread inside an application
问题描述
我运行的GStreamer的样本程序,它正在从C ++应用程序作为一个线程调用。已经设置了 GST_DEBUG = *:5
级别来捕获所有可能出现的情况。
I am running a sample program of gstreamer which is being called from a C++ application as a thread. Have set the GST_DEBUG=*:5
level to capture all the possible scenarios.
应用程序也打印在标准输出上很多很多的日志和GStreamer的线程也做了同样的(5级增加了痛苦)。
The application also prints lots and lots of logs on stdout and the gstreamer thread also does the same( the level 5 adds to the misery).
问题 - 有没有办法分离出的GStreamer线程的日志打印在给定的调试级别的文件
Question -- Is there a way to separate out the log printing of gstreamer thread in a file with the given debug level ?
问题补充 - 设置GST_DEBUG_FILE基于以下答案的答案,但该文件由一些字符开始,而不是从GST_DEBUG像
Supplementary question -- Set the GST_DEBUG_FILE based on answer below answer but the file starts from some characters and not from GST_DEBUG like
0:00:00.000036045 ^[[335m21088^[[00m 0x8405800 ^[[37mLOG ^[[00m ^[[00;01;33m GST_DEBUG gstinfo.c:1329:for_each_threshold_by_entry:^[[00m category default matches pattern 0x8405570 - gets set to level 5
0:00:00.000109741 ^[[335m21088^[[00m 0x8405800 ^[[32;01mINFO ^[[00m ^[[00;01;31m GST_INIT gst.c:613:init_pre:^[[00m Initializing GStreamer Core Library version 0.10.36
0:00:00.000123496 ^[[335m21088^[[00m 0x8405800 ^[[32;01mINFO ^[[00m ^[[00;01;31m GST_INIT gst.c:614:init_pre:^[[00m Using library installed in /usr/lib/i386-linux-gnu
Q2如何从GST删除这些字符,如^ [[和启动?
Q2 How to remove these characters like "^[[" and start from GST ?
引用结果
找到了<一个href=\"http://stackoverflow.com/questions/1612317/how-to-log-into-separate-files-per-thread-with-log4net\">similar问题
推荐答案
GST_DEBUG_FILE =的/ tmp / gst.log会把所有记录到该文件中,但单独的日志为单独的线程,你需要编写自己的loghandler。在gstinfo.c一看,gst_debug_add_log_function。
GST_DEBUG_FILE=/tmp/gst.log will put all the logging into that file, but for separate log for separate threads you will need to write your own loghandler. Have a look in gstinfo.c, and gst_debug_add_log_function.
至于你的第二季度,再次,你需要编写自己的loghandler如果你想让它从GST开始,因为这些其他领域(时间戳,进程ID,线程等)都包含在默认loghandler。 (再次看到gstinfo.c,gst_debug_log_default)
As for your Q2, again, you will need to write your own loghandler if you want it to start from GST, since these other fields (timestamp, process-id, thread etc.) are included in the default loghandler. (again see gstinfo.c, gst_debug_log_default)
这篇关于GST_DEBUG:如何保存日志在一个单独的文件中一个线程的应用程序内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!