int main()
{
  log_DEBUG(PSTR("debug"));
  log_INFORMATIONAL(PSTR("informational"));
  log_NOTICE(PSTR("notice"));
  log_WARNING(PSTR("warning"));
  log_ERROR(PSTR("error"));
  log_CRITICAL(PSTR("critical"));
  log_ALERT(PSTR("alert"));
  log_EMERGENCY(PSTR("emergency"));

  return EXIT_SUCCESS;
}
Exemple #2
0
	void Logs::PLUGIN_LOG(const char* file, int line, const char* function, const char* format, ...)
	{
		if (Settings::getInstance()->IsLogEnabled && Settings::getInstance()->SeePluginLog)
		{
			char buffer[2048];
			memset(buffer, 0x00, sizeof(buffer));
			va_list args;
			va_start (args, format);
	#if defined(__unix__)
			vsnprintf(buffer, sizeof(buffer) - 1, format, args);
	#else
			_vsnprintf_s(buffer, sizeof(buffer) - 1, format, args);
	#endif
			log_INFORMATIONAL(processLog(file, line, function, buffer));
			va_end(args);
		}
	}
static void some_logging_1()
{
    short                   s       =   123;
    int                     i       =   456;
    long                    l       =   789;
    float                   f       =   (float)(0.123);
    double                  d       =   0.456;
    long double             ld      =   0.789;
    void                    *p      =   &l;
    char const              *lstr   =   "{a pointer to a C-style string}";

#if 0
    log_INFORMATIONAL(  "This is a (hopefully) typical error string, containing: "
                        ,   "some integers (", integer(s), ", ", integer(i), ", ", integer(l), "); "
                        ,   "some real numbers (", real(f), ", ", real(d), ", ", real(ld), "); "
                        ,   "a pointer (", pointer(p, fmt::hex), "); "
                        ,   "some strings (", lstr, ", ", str, ", ", sstr, "); "
                        ,   "and a converted time value (", tm, ")"
                     );
#endif /* 0 */
}