]> cygwin.com Git - cygwin-apps/setup.git/blob - log.cc
2003-06-22 Max Bowsher <maxb@ukf.net>
[cygwin-apps/setup.git] / log.cc
1 /*
2 * Copyright (c) 2000, Red Hat, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
11 *
12 * Written by DJ Delorie <dj@redhat.com>
13 *
14 */
15
16 /* The purpose of this file is to centralize all the logging functions. */
17
18 #if 0
19 static const char *cvsid =
20 "\n%%% $Id$\n";
21 #endif
22
23 #include "win32.h"
24 #include <stdio.h>
25 #include <stdarg.h>
26 #include <stdlib.h>
27 #include <time.h>
28
29 #include "resource.h"
30 #include "msg.h"
31 #include "log.h"
32 #include "dialog.h"
33 #include "state.h"
34 #include "mkdir.h"
35 #include "mount.h"
36
37 #include "io_stream.h"
38
39 void
40 log (enum log_level level, String const &message)
41 {
42 LogSingleton::GetInstance()(level) << message << endLog;
43 }
44
45 void
46 log (enum log_level level, const char *fmt, ...)
47 {
48 char buf[1000];
49 va_list args;
50 va_start (args, fmt);
51 vsnprintf (buf, 1000, fmt, args);
52 log (level, String(buf));
53 }
This page took 0.035962 seconds and 5 git commands to generate.