MLT  7.28.0
Macros | Functions
mlt_log.h File Reference

logging functions More...

#include <stdarg.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define MLT_LOG_DEBUG   48
 stuff which is only useful for MLT developers More...
 
#define mlt_log_debug(service, format, args...)   mlt_log((service), MLT_LOG_DEBUG, (format), ##args)
 
#define MLT_LOG_ERROR   16
 something went wrong and cannot losslessly be recovered but not all future data is affected More...
 
#define mlt_log_error(service, format, args...)   mlt_log((service), MLT_LOG_ERROR, (format), ##args)
 
#define MLT_LOG_FATAL   8
 something went wrong and recovery is not possible like no header in a format which depends on it or a combination of parameters which are not allowed More...
 
#define mlt_log_fatal(service, format, args...)   mlt_log((service), MLT_LOG_FATAL, (format), ##args)
 
#define MLT_LOG_INFO   32
 
#define mlt_log_info(service, format, args...)   mlt_log((service), MLT_LOG_INFO, (format), ##args)
 
#define MLT_LOG_PANIC   0
 something went really wrong and we will crash now More...
 
#define mlt_log_panic(service, format, args...)   mlt_log((service), MLT_LOG_PANIC, (format), ##args)
 
#define MLT_LOG_QUIET   -8
 
#define MLT_LOG_TIMINGS   44
 
#define mlt_log_timings(service, format, args...)    mlt_log((service), MLT_LOG_TIMINGS, (format), ##args)
 
#define mlt_log_timings_begin()
 
#define mlt_log_timings_end(service, msg)
 
#define MLT_LOG_VERBOSE   40
 
#define mlt_log_verbose(service, format, args...)    mlt_log((service), MLT_LOG_VERBOSE, (format), ##args)
 
#define MLT_LOG_WARNING   24
 something somehow does not look correct / something which may or may not lead to some problems More...
 
#define mlt_log_warning(service, format, args...)    mlt_log((service), MLT_LOG_WARNING, (format), ##args)
 

Functions

void mlt_log (void *service, int level, const char *fmt,...)
 Send the specified message to the log if the level is less than or equal to the current logging level. More...
 
int mlt_log_get_level (void)
 
void mlt_log_set_callback (void(*)(void *, int, const char *, va_list))
 
void mlt_log_set_level (int)
 
int64_t mlt_log_timings_now (void)
 
void mlt_vlog (void *service, int level, const char *fmt, va_list)
 

Detailed Description

logging functions

Copyright (C) 2004-2014 Meltytech, LLC

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Macro Definition Documentation

◆ MLT_LOG_DEBUG

#define MLT_LOG_DEBUG   48

stuff which is only useful for MLT developers

◆ mlt_log_debug

#define mlt_log_debug (   service,
  format,
  args... 
)    mlt_log((service), MLT_LOG_DEBUG, (format), ##args)

◆ MLT_LOG_ERROR

#define MLT_LOG_ERROR   16

something went wrong and cannot losslessly be recovered but not all future data is affected

◆ mlt_log_error

#define mlt_log_error (   service,
  format,
  args... 
)    mlt_log((service), MLT_LOG_ERROR, (format), ##args)

◆ MLT_LOG_FATAL

#define MLT_LOG_FATAL   8

something went wrong and recovery is not possible like no header in a format which depends on it or a combination of parameters which are not allowed

◆ mlt_log_fatal

#define mlt_log_fatal (   service,
  format,
  args... 
)    mlt_log((service), MLT_LOG_FATAL, (format), ##args)

◆ MLT_LOG_INFO

#define MLT_LOG_INFO   32

◆ mlt_log_info

#define mlt_log_info (   service,
  format,
  args... 
)    mlt_log((service), MLT_LOG_INFO, (format), ##args)

◆ MLT_LOG_PANIC

#define MLT_LOG_PANIC   0

something went really wrong and we will crash now

◆ mlt_log_panic

#define mlt_log_panic (   service,
  format,
  args... 
)    mlt_log((service), MLT_LOG_PANIC, (format), ##args)

◆ MLT_LOG_QUIET

#define MLT_LOG_QUIET   -8

◆ MLT_LOG_TIMINGS

#define MLT_LOG_TIMINGS   44

◆ mlt_log_timings

#define mlt_log_timings (   service,
  format,
  args... 
)     mlt_log((service), MLT_LOG_TIMINGS, (format), ##args)

◆ mlt_log_timings_begin

#define mlt_log_timings_begin ( )
Value:
{ \
int64_t _mlt_log_timings_begin = mlt_log_timings_now(), _mlt_log_timings_end;
int64_t mlt_log_timings_now(void)
Definition: mlt_log.c:107

◆ mlt_log_timings_end

#define mlt_log_timings_end (   service,
  msg 
)
Value:
_mlt_log_timings_end = mlt_log_timings_now(); \
mlt_log_timings(service, \
"%s:%d: T(%s)=%" PRId64 " us\n", \
__FILE__, \
__LINE__, \
msg, \
_mlt_log_timings_end - _mlt_log_timings_begin); \
}

◆ MLT_LOG_VERBOSE

#define MLT_LOG_VERBOSE   40

◆ mlt_log_verbose

#define mlt_log_verbose (   service,
  format,
  args... 
)     mlt_log((service), MLT_LOG_VERBOSE, (format), ##args)

◆ MLT_LOG_WARNING

#define MLT_LOG_WARNING   24

something somehow does not look correct / something which may or may not lead to some problems

◆ mlt_log_warning

#define mlt_log_warning (   service,
  format,
  args... 
)     mlt_log((service), MLT_LOG_WARNING, (format), ##args)

Function Documentation

◆ mlt_log()

void mlt_log ( void *  service,
int  level,
const char *  fmt,
  ... 
)

Send the specified message to the log if the level is less than or equal to the current logging level.

By default, all logging messages are sent to stderr. This behavior can be altered by setting a different mlt_vlog callback function.

Parameters
serviceAn optional pointer to a mlt_service_s.
levelThe importance level of the message, lower values signifying higher importance.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
See also
mlt_vlog

◆ mlt_log_get_level()

int mlt_log_get_level ( void  )

◆ mlt_log_set_callback()

void mlt_log_set_callback ( void(*)(void *, int, const char *, va_list)  new_callback)

◆ mlt_log_set_level()

void mlt_log_set_level ( int  level)

◆ mlt_log_timings_now()

int64_t mlt_log_timings_now ( void  )

◆ mlt_vlog()

void mlt_vlog ( void *  service,
int  level,
const char *  fmt,
va_list  vl 
)