打开Android PVLogger的方法

系统默认是没有启用pvlogger的,需要修改一些地方来启用这个log,log记录得很详细,作用很多,可以帮助查找错误或者去帮助阅读代码.
   
需要修改的地方.
   
/external/opencore/Config.mk

在第10行,

ifeq ($(ENABLE_PV_LOGGING),1)
  PV_CFLAGS += -DPVLOGGER_INST_LEVEL=5
endif

之前,添加一行

ENABLE_PV_LOGGING := 1   

/external/opencore/oscl/oscl/osclbase/src/pvlogger.h
在第138行左右添加
#define PVLOGGER_INST_LEVEL 5


完成这些之后,make sdk
启动模拟器,在sdcard中新建一个pvlogger.txt文件写入8即可
 echo 8 >/sdcard/ pvlogger.txt
或者可以过滤一些logger,可以这么写,比如只看PVPlayerEngine的log
 echo 8,PVPlayerEngine > /sdcard/pvlogger.txt

 

***************************************************************************
在 PVLoggerConfigFil可以看到一段话.

class PVLoggerConfigFile{
/* 
    To configure logging at runtime, a file pvlogger.txt must be located in the sdcard.
    The format for log level and logger tag in the file should be: "level,node".  Note that there should be no space between log level and logger tag.
    For example, pvlogger.txt can look like:
    1,PVPlayerEngine
    8,PVSocketNode
    Above example means log the message level PVLOGMSG_ALERT for PVPlayerEngine and PVLOGMSG_DEBUG for PVSocketNode.  See pvlogger.h for log level values.
*/
public:
    PVLoggerConfigFile():iLogFileRead(false)

你可能感兴趣的:(android,File,logging)