File tree 3 files changed +17
-0
lines changed
3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,13 @@ LegalSyslog::LegalSyslog(const DatabaseConnection::ParameterMap& parameters)
29
29
LoggingInfo info;
30
30
// Remove default destinations as we are going to replace them.
31
31
info.clearDestinations ();
32
+ // / The name of the logger may be no longer than MAX_LOGGER_NAME_SIZE
33
+ // / else the program will throw an exception. This restriction allows
34
+ // / loggers to be declared statically: the name is stored in a fixed-size
35
+ // / array to avoid the need to allocate heap storage during program
36
+ // / initialization (which causes problems on some operating systems).
37
+ // / e.g. or error: '<logger-name>' is not a valid name for a logger:
38
+ // / valid names must be between 1 and 31 characters in length.
32
39
info.name_ = " legal-log-" ;
33
40
info.name_ += boost::lexical_cast<std::string>(reinterpret_cast <uint64_t >(this ));
34
41
logger_.reset (new Logger (info.name_ .c_str ()));
Original file line number Diff line number Diff line change @@ -157,6 +157,8 @@ class Logger {
157
157
// / loggers to be declared statically: the name is stored in a fixed-size
158
158
// / array to avoid the need to allocate heap storage during program
159
159
// / initialization (which causes problems on some operating systems).
160
+ // / e.g. or error: '<logger-name>' is not a valid name for a logger:
161
+ // / valid names must be between 1 and 31 characters in length.
160
162
// /
161
163
// / \note Note also that there is no constructor taking a std::string. This
162
164
// / minimizes the possibility of initializing a static logger with a
Original file line number Diff line number Diff line change @@ -63,6 +63,14 @@ class LoggerImpl : public boost::noncopyable {
63
63
// /
64
64
// / Creates a logger of the specific name.
65
65
// /
66
+ // / \note The name of the logger may be no longer than MAX_LOGGER_NAME_SIZE
67
+ // / else the program will throw an exception. This restriction allows
68
+ // / loggers to be declared statically: the name is stored in a fixed-size
69
+ // / array to avoid the need to allocate heap storage during program
70
+ // / initialization (which causes problems on some operating systems).
71
+ // / e.g. or error: '<logger-name>' is not a valid name for a logger:
72
+ // / valid names must be between 1 and 31 characters in length.
73
+ // /
66
74
// / \param name Name of the logger.
67
75
LoggerImpl (const std::string& name);
68
76
You can’t perform that action at this time.
0 commit comments