1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

add log level in conf. change to 0.9.45

This commit is contained in:
winlin 2014-04-03 18:32:51 +08:00
parent 4984631cd6
commit 3f13726544
12 changed files with 103 additions and 43 deletions

View file

@ -31,6 +31,15 @@ ISrsLog::~ISrsLog()
{
}
int ISrsLog::level()
{
return SrsLogLevel::Trace;
}
void ISrsLog::set_level(int /*level*/)
{
}
void ISrsLog::verbose(const char* /*tag*/, int /*context_id*/, const char* /*fmt*/, ...)
{
}

View file

@ -35,6 +35,23 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <errno.h>
#include <string.h>
/**
* the log level, for example:
* if specified Debug level, all level messages will be logged.
* if specified Warn level, only Warn/Error/Fatal level messages will be logged.
*/
class SrsLogLevel
{
public:
// only used for very verbose debug, generally,
// we compile without this level for high performance.
static const int Verbose = 0x01;
static const int Info = 0x02;
static const int Trace = 0x03;
static const int Warn = 0x04;
static const int Error = 0x05;
};
/**
* the log interface provides method to write log.
* but we provides some macro, which enable us to disable the log when compile.
@ -46,6 +63,11 @@ public:
ISrsLog();
virtual ~ISrsLog();
public:
/**
* defined in SrsLogLevel.
*/
virtual int level();
virtual void set_level(int level);
/**
* log for verbose, very verbose information.
*/