X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fsilclog.h;h=56c58ec345691f9b74964a78ebcc7d541d644d5b;hb=e7b6c157b80152bf9fb9266e6bdd93f9fb0db776;hp=4ae8ca9ccf08ad1034e9391e07a808833aa7fed7;hpb=41ca2c760fa7dd7c941a65654e0b380b2ccf1a27;p=silc.git diff --git a/lib/silcutil/silclog.h b/lib/silcutil/silclog.h index 4ae8ca9c..56c58ec3 100644 --- a/lib/silcutil/silclog.h +++ b/lib/silcutil/silclog.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 1997 - 2006 Pekka Riikonen + Copyright (C) 1997 - 2007 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -317,7 +317,7 @@ typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line, * * DESCRIPTION * - * Verification macro that prints error message to stderr and calls + * Verification macro that prints error message to stderr and calls * abort() if the `expression' is false (ie. compares equal to zero) * on debug builds (SILC_DEBUG defined), and prints error message to * stderr on release builds (SILC_DEBUG undefined) but does not abort(). @@ -330,8 +330,12 @@ typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line, #define SILC_VERIFY(expr) assert((expr)); #else #define SILC_VERIFY(expr) \ - if (!(expr)) \ - SILC_LOG_ERROR(("SILC_VERIFY %s:%d", __FUNCTION__, __LINE__)); + if (silc_unlikely(!(expr))) { \ + SILC_LOG_ERROR(("SILC_VERIFY %s:%s:%d", \ + __FILE__, __FUNCTION__, __LINE__)); \ + silc_set_errno_reason_nofail(SILC_ERR_ASSERT, "SILC_VERIFY %s:%s:%d", \ + __FILE__, __FUNCTION__, __LINE__); \ + } #endif /* SILC_DEBUG */ /***/ @@ -342,8 +346,8 @@ typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line, * SYNOPSIS * * SilcBool silc_log_set_file(SilcLogType type, char *filename, - * SilcUInt32 maxsize, - * SilcSchedule scheduler); + * SilcUInt32 maxsize, + * SilcSchedule scheduler); * * DESCRIPTION * @@ -355,7 +359,8 @@ typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line, * You can disable logging for a channel by specifying NULL filename, the * maxsize in this case is not important. The `scheduler' parameter is * needed by the internal logging to allow buffered output and thus to - * save HD activity. + * save HD activity. If `scheduler' is NULL this will call + * silc_schedule_get_global to try to get global scheduler. * ***/ SilcBool silc_log_set_file(SilcLogType type, char *filename,