diff options
-rw-r--r-- | brep/module.cxx | 11 | ||||
-rw-r--r-- | web/module | 13 |
2 files changed, 16 insertions, 8 deletions
diff --git a/brep/module.cxx b/brep/module.cxx index 4ce635a..a803386 100644 --- a/brep/module.cxx +++ b/brep/module.cxx @@ -35,7 +35,7 @@ namespace brep try { - static const char* s[] = {"err", "warn", "info", "trace"}; + static const char* sev_str[] = {"error", "warning", "info", "trace"}; std::ostream& o = rs.content (500, "text/plain;charset=utf-8"); for (const auto& d: e.data) @@ -52,12 +52,17 @@ namespace brep name = d.name; } - o << "[" << s[static_cast<int> (d.sev)] << "] [" - << name << "] " << d.msg << std::endl; + o << name << ": " << sev_str[d.sev] << ": " << d.msg << endl; + + //o << "[" << s[static_cast<int> (d.sev)] << "] [" + // << name << "] " << d.msg << std::endl; } } catch (const sequence_error&) { + // We tried to return the error status/description but some + // content has already been written. Nothing we can do about + // it. } } } @@ -165,14 +165,17 @@ namespace web class module { public: - // The web server calls this method on the module exemplar prior - // accepting client requests. Configuration file path is passed - // as a parameter. The way configuration file content interpreted is - // module implementation specific. Any exception thrown terminates web + // During startup the web server calls this function on the + // module exemplar passing a list of configuration name-value + // pairs. The place these configuration pairs come from is + // implementation-specific (normally a configuration file). + // Any exception thrown by this function terminates the web // server. // + // @@ Is log available? Should we pass it? + // virtual void - init (const char* path) = 0; + init (const name_values&) = 0; // Any exception other than invalid_request described above that // leaves this function is treated by the web server implementation |