GST_DEBUG:如何将日志保存在应用程序中的线程的单独文件中 [英] GST_DEBUG: How to save logs in a separate file for a thread inside an application

查看:295
本文介绍了GST_DEBUG:如何将日志保存在应用程序中的线程的单独文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行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.

应用程序还在stdout上打印大量日志,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 ?

参考文献

找到一个类似问题

推荐答案

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.

至于你的Q2,你需要编写自己的loghandler,如果你想从GST开始,因为这些其他字段(时间戳,进程ID,线程等)包括在默认日志处理程序中。 (再次参见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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆