~alivema4ever/ubuntu/trusty/weechat/lp-1299347-fix

« back to all changes in this revision

Viewing changes to src/core/wee-log.c

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bouthenot
  • Date: 2013-01-23 18:44:36 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20130123184436-pillcj7jmtyyj00j
Tags: 0.4.0-1
* New upstream release.
* Bump Standards-Version to 3.9.4
* Remove UPGRADE_0.3 from doc (no more included in upstream sources).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2003-2012 Sebastien Helleu <flashcode@flashtux.org>
 
2
 * wee-log.c - WeeChat log file (weechat.log)
 
3
 *
 
4
 * Copyright (C) 2003-2013 Sebastien Helleu <flashcode@flashtux.org>
3
5
 * Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org>
4
6
 *
5
7
 * This file is part of WeeChat, the extensible chat client.
18
20
 * along with WeeChat.  If not, see <http://www.gnu.org/licenses/>.
19
21
 */
20
22
 
21
 
/*
22
 
 * wee-log.c: WeeChat log file
23
 
 */
24
 
 
25
23
#ifdef HAVE_CONFIG_H
26
24
#include "config.h"
27
25
#endif
43
41
#include "wee-log.h"
44
42
#include "wee-debug.h"
45
43
#include "wee-string.h"
 
44
#include "wee-version.h"
46
45
#include "../plugins/plugin.h"
47
46
 
48
47
 
53
52
 
54
53
 
55
54
/*
56
 
 * log_open: initialize log file
 
55
 * Opens the WeeChat log file.
 
56
 *
 
57
 * Returns:
 
58
 *   1: OK
 
59
 *   0: error
57
60
 */
58
61
 
59
62
int
101
104
}
102
105
 
103
106
/*
104
 
 * log_init: initialize log file
 
107
 * Initializes the WeeChat log file.
105
108
 */
106
109
 
107
110
void
115
118
                                "with another home using \"--dir\" command line option.\n"));
116
119
        exit (1);
117
120
    }
118
 
    log_printf ("%s (%s %s %s)",
119
 
                PACKAGE_STRING, _("compiled on"), __DATE__, __TIME__);
 
121
    log_printf ("WeeChat %s (%s %s %s)",
 
122
                version_get_version_with_git (),
 
123
                _("compiled on"),
 
124
                version_get_compilation_date (),
 
125
                version_get_compilation_time ());
120
126
}
121
127
 
122
128
/*
123
 
 * log_printf: write a message in WeeChat log (<weechat_home>/weechat.log)
 
129
 * Writes a message in WeeChat log file.
124
130
 */
125
131
 
126
132
void
173
179
}
174
180
 
175
181
/*
176
 
 * log_printf_hexa: dump a string as hexa data in log file
 
182
 * Dumps a string as hexa data in WeeChat log file.
177
183
 */
178
184
 
179
185
void
207
213
}
208
214
 
209
215
/*
210
 
 * log_close: close log file
 
216
 * Closes the WeeChat log file.
211
217
 */
212
218
 
213
219
void
232
238
}
233
239
 
234
240
/*
235
 
 * log_crash_rename: rename log file when crashing
 
241
 * Renames the WeeChat log file (when crashing).
 
242
 *
 
243
 * The file "weechat.log" is renamed to "weechat_crash_YYYYMMDD_NNNN.log",
 
244
 * where YYYYMMDD is the current date and NNNN the PID of WeeChat process.
236
245
 */
237
246
 
238
247
int