* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
- *
- * $Id: s_log.c 3209 2007-02-11 16:54:43Z jilles $
*/
#include "stdinc.h"
if(access(dirname, F_OK) == -1)
{
- rb_snprintf(buf, sizeof(buf), "WARNING: Unable to access logfile %s - parent directory %s does not exist", filename, dirname);
+ snprintf(buf, sizeof(buf), "WARNING: Unable to access logfile %s - parent directory %s does not exist", filename, dirname);
if(testing_conf || server_state_foreground)
fprintf(stderr, "%s\n", buf);
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", buf);
{
if(access(dirname, W_OK) == -1)
{
- rb_snprintf(buf, sizeof(buf), "WARNING: Unable to access logfile %s - access to parent directory %s failed: %s",
+ snprintf(buf, sizeof(buf), "WARNING: Unable to access logfile %s - access to parent directory %s failed: %s",
filename, dirname, strerror(errno));
if(testing_conf || server_state_foreground)
fprintf(stderr, "%s\n", buf);
if(access(filename, W_OK) == -1)
{
- rb_snprintf(buf, sizeof(buf), "WARNING: Access denied for logfile %s: %s", filename, strerror(errno));
+ snprintf(buf, sizeof(buf), "WARNING: Access denied for logfile %s: %s", filename, strerror(errno));
if(testing_conf || server_state_foreground)
fprintf(stderr, "%s\n", buf);
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s", buf);
return;
va_start(args, format);
- rb_vsnprintf(buf, sizeof(buf), format, args);
+ vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
- rb_snprintf(buf2, sizeof(buf2), "%s %s\n",
+ snprintf(buf2, sizeof(buf2), "%s %s\n",
smalldate(rb_current_time()), buf);
if(fputs(buf2, logfile) < 0)
fprintf(stderr, "%8s: %s\n", domain, buf);
}
+void
+idebug(const char *format, ...)
+{
+#ifndef NDEBUG
+ char buf[BUFSIZE];
+ va_list args;
+
+ va_start(args, format);
+ vsnprintf(buf, sizeof(buf), format, args);
+ va_end(args);
+
+ _iprint("debug", buf);
+
+ ilog(L_MAIN, "%s", buf);
+#endif
+}
+
void
inotice(const char *format, ...)
{
va_list args;
va_start(args, format);
- rb_vsnprintf(buf, sizeof(buf), format, args);
+ vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
_iprint("notice", buf);
va_list args;
va_start(args, format);
- rb_vsnprintf(buf, sizeof(buf), format, args);
+ vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
_iprint("warning", buf);
va_list args;
va_start(args, format);
- rb_vsnprintf(buf, sizeof(buf), format, args);
+ vsnprintf(buf, sizeof(buf), format, args);
va_end(args);
_iprint("error", buf);
lt = localtime(<ime);
- rb_snprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d",
+ snprintf(buf, sizeof(buf), "%d/%d/%d %02d.%02d",
lt->tm_year + 1900, lt->tm_mon + 1,
lt->tm_mday, lt->tm_hour, lt->tm_min);