Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 83 lines (69 sloc) 3.792 kB
e333ea7 CPDLib in Git!
Aaron Andersen authored
1 <?
2 /** CPDLog Config: CPD Library Logging Module Configuration File
3 *
4 * The Common PHP Development Library
5 * Copyright (C) 2010 Aaron Andersen
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License 2.1 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 *
17 * Contains defaults and notes possibile values of configuration settings for the CPDLog module. The
18 * functions that use these values depend on them being set here; to return a previously set setting
19 * to the default, you must manually restore its value to such.
20 */
21
22
23 /** cpdlog.output_dir: <string>; default: __DIR__.'/log';
24 *
25 * The system directory in which the various log files should be created. This should normally be an
26 * absolute path (from the root of the filesystem), something based on $_SERVER['document_root'], or
27 * use the __DIR__ macro to reference a folder relative to the location of the cpd library files. If
28 * a relative path is used here it will be relative to the location of the original PHP script being
29 * executed, which would result in separate log files created for PHP files in different directories
30 * (not what you want in most cases, though useful occasionally). If this directory doesn't exist it
31 * will be automatically created. Do not use a trailing slash.
32 */
33 $cpdconf['cpdlog']['output_dir'] = __DIR__.'/log';
34
35
36 /** cpdlog.filename_prefix: <string>; default: 'cpdlog_';
37 *
38 * Prefix to attach to the log file names given as function parameters. This allows you to have some
39 * common prefix on all your log file names without having to type it again and again in your source
40 * code. Can be set to the empty string to not use a filename prefix.
41 */
42 $cpdconf['cpdlog']['filename_prefix'] = 'cpdlog_';
43
44
45 /** cpdlog.filename_suffix: <string>; default: '.txt';
46 *
47 * Suffix to attach to the log file names given as function parameters. This should include the file
48 * extension that you want to use (commonly .txt, .log, or .dat). To have a different file extension
49 * on different log files, set this to the empty string and include the desired extension in each of
50 * your calls to the cpdlog functions.
51 */
52 $cpdconf['cpdlog']['filename_suffix'] = '.txt';
53
54
55
56 /** cpdlog.time_format: <string>; default: '[Y-m-d H:i:s] ';
57 *
58 * The format for printing timestamps in log entires. For complete details regarding the codes used,
59 * see the documentation for PHP's date() function. This will be placed on the beginning of the line
60 * in single line log entries, and as a line of its own in block log entires.
61 */
62 $cpdconf['cpdlog']['time_format'] = '[Y-m-d H:i:s] ';
63
64
65 /** cpdlog.endl: <string>; default: PHP_EOL;
66 *
67 * Line break character to use in log files. This defaults to PHP_EOL, which is the correct platform
68 * dependent character to use depending on what OS PHP is running on. Override this to force all log
69 * functions to use '\n' or '\r\n' (or some other crazy thing) regardless of the underlying OS.
70 */
71 $cpdconf['cpdlog']['endl'] = PHP_EOL;
72
73
74 /** cpdlog.new_block: <string>; default: str_repeat("-", 80);
75 *
76 * A line of text to output between blocks in block log files. This is used to make it easier to see
77 * where one block of logged text starts and another begins. This could be set to a few new lines to
78 * make a visible area of whitespace between blocks, or a sequence of some character to build a long
79 * "header line" in the output file.
80 */
81 $cpdconf['cpdlog']['new_block'] = str_repeat("-", 80).PHP_EOL;
82
83 ?>
Something went wrong with that request. Please try again.