Exemplo n.º 1
0
void print(const char *message, ...)
{
	va_list ap;
	va_start(ap, message);
	vLog(MESSAGE, "Unknown", message, WHITE, ap);
	va_end(ap);
}
Exemplo n.º 2
0
void Log(log_level level, const char* owner, const char* message, ...)
{
	va_list ap;
	va_start(ap, message);
	vLog(level, owner, message, WHITE, ap);
	va_end(ap);
}
Exemplo n.º 3
0
void Logger::log(const char* tag, const char* fmt, ...)
{
	va_list list;
	
	va_start(list, fmt);
	vLog(tag, fmt, list);
	va_end(list);
}
Exemplo n.º 4
0
void Log(int level, char const *classname, char const *funcname,
         char const *format, ...) {
  va_list ap;

  va_start(ap, format);
  vLog(level, classname, funcname, format, ap);
  va_end(ap);
}
Exemplo n.º 5
0
void Logger::log(std::ostream& stream, const char* tag, const char* fmt, ...)
{
	va_list list;
	
	va_start(list, fmt);
	vLog(stream, tag, fmt, list);
	va_end(list);
}
Exemplo n.º 6
0
/* main ===================================================================== */
int
main (void) {
  static volatile int i;

  vLedInit();
  FILE * tc = xFileOpen (PORT, O_RDWR | O_NONBLOCK, &settings);
  stdout = tc;
  stderr = tc;
  stdin = tc;
  sei();

  for (;;) {

    test_count = 1;
    printf_P (PSTR ("\nAvrIO Log test\n"
                    "Press any key to proceed...\n"));
    while (getchar() == EOF)
      ;

    vLogSetMask (LOG_UPTO (LOG_INFO));
    i = iLogMask();
    test (i == LOG_UPTO (LOG_INFO));

    vLog_P (LOG_INFO, flashstr, ++test_count);
    vLog (LOG_INFO, ramstr, ++test_count);

    for (i = LOG_DEBUG; i >= LOG_EMERG; i--) {

      fprintf_P (stderr, PSTR ("\nPriority up to %s\n"), sLogPriorityString(i));
      vLogSetMask (LOG_UPTO (i));
      vLedSet (LED_LED1);
      
      PERROR ("Error %d", test_count++);
      vLedClear (LED_LED1);
      delay_ms (5);
      vLedSet (LED_LED1);
      PWARNING ("Warning %d", test_count++);
      vLedClear (LED_LED1);
      delay_ms (5);
      vLedSet (LED_LED1);
      PNOTICE ("Notice %d", test_count++);
      vLedClear (LED_LED1);
      delay_ms (5);
      vLedSet (LED_LED1);
      PINFO ("Info %d", test_count++);
      vLedClear (LED_LED1);
      PDEBUG ("Debug %d", test_count++);
      PERROR ("Error %d", test_count++);
      PWARNING ("Warning %d", test_count++);
      PNOTICE ("Notice %d", test_count++);
      PINFO ("Info %d", test_count++);
      PDEBUG ("Debug %d", test_count++);
    }

  }
  return 0;
}
Exemplo n.º 7
0
void
Debug(const char *fmt, ...)   // IN: format string, etc.
{
   va_list args;

   compat_va_start(args, fmt);
   vLog(fmt, args);
   compat_va_end(args);
}
Exemplo n.º 8
0
void CNCSLogInternal::Log(ENCSLogLevel eLevel, char *szFormat, ... )
{
	va_list args;
	va_start(args, szFormat);

	vLog(eLevel, szFormat, args);

	va_end(args);
}
Exemplo n.º 9
0
void error(const char* owner, const char* message, ...)
{
	va_list ap;
	va_start(ap, message);
	vLog(FATAL, owner, message, LIGHT_RED, ap);
	va_end(ap);

	ShutdownLogging();

	exit(1);
}
Exemplo n.º 10
0
void Log
(
    const char *fmt,    ///< printf style format specifier
    ...                 ///< variable list of arguments
)
{
    va_list args;

    va_start( args, fmt );
    vLog( fmt, args );
    va_end( args );
}
Exemplo n.º 11
0
void LogError
(
    const char *fmt,    ///< printf style format specifier
    ...                 ///< variable list of arguments
)
{
    va_list args;

#if defined( AVR )
    Log_P( PSTR( "ERROR: " ));

    va_start( args, fmt );
    vLog( fmt, args );
    va_end( args );
#else
    va_start( args, fmt );
    vLogFunc( LOG_LEVEL_ERROR, fmt, args );
    va_end( args );
#endif

} // LogError
Exemplo n.º 12
0
/*
 *  Loader::Log
 *      Logs the message (msg, ..., '\n') into the logging stream
 */
void Loader::Log(const char* msg, ...)
{
    va_list va; va_start(va, msg);
    vLog(msg, va);
    va_end(va);
}
Exemplo n.º 13
0
void Logger::vLog(const char* tag, const char* fmt, va_list list)
{
	vLog(*m_defaultStream, tag, fmt, list);
}
Exemplo n.º 14
0
void Logger::vLog(const char* fmt, va_list list)
{
	vLog(Default.c_str(), fmt, list);
}