X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fservermain.cpp;h=64853604b1a8ec64c11de1411005e66dec95a43f;hb=8492796a5c45787810aad7fe08fc63cadc0c96b5;hp=d429d2078d808e85426749b5b9c48aeec028b5c6;hpb=9e46cbf7ea512330f35d0f2ede0c7c0c085c7cf4;p=oweals%2Fminetest.git diff --git a/src/servermain.cpp b/src/servermain.cpp index d429d2078..64853604b 100644 --- a/src/servermain.cpp +++ b/src/servermain.cpp @@ -73,6 +73,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "defaultsettings.h" #include "settings.h" #include "profiler.h" +#include "log.h" +#include "nodedef.h" // For init_contentfeatures +#include "content_mapnode.h" // For content_mapnode_init /* Settings. @@ -85,24 +88,21 @@ Settings *g_settings = &main_settings; Profiler main_profiler; Profiler *g_profiler = &main_profiler; -// A dummy thing -ITextureSource *g_texturesource = NULL; - /* Debug streams */ // Connection std::ostream *dout_con_ptr = &dummyout; -std::ostream *derr_con_ptr = &dstream_no_stderr; +std::ostream *derr_con_ptr = &verbosestream; // Server -std::ostream *dout_server_ptr = &dstream; -std::ostream *derr_server_ptr = &dstream; +std::ostream *dout_server_ptr = &infostream; +std::ostream *derr_server_ptr = &errorstream; // Client -std::ostream *dout_client_ptr = &dstream; -std::ostream *derr_client_ptr = &dstream; +std::ostream *dout_client_ptr = &infostream; +std::ostream *derr_client_ptr = &errorstream; /* gettime.h implementation @@ -116,12 +116,37 @@ u32 getTimeMs() return porting::getTimeMs(); } +class StderrLogOutput: public ILogOutput +{ +public: + /* line: Full line with timestamp, level and thread */ + void printLog(const std::string &line) + { + std::cerr<readConfigFile(cmd_args.get("config").c_str()); if(r == false) { - dstream<<"Could not read configuration from \"" + errorstream<<"Could not read configuration from \"" < filenames; - filenames.push_back(porting::path_userdata + "/minetest.conf"); + filenames.push_back(porting::path_userdata + + DIR_DELIM + "minetest.conf"); #ifdef RUN_IN_PLACE - filenames.push_back(porting::path_userdata + "/../minetest.conf"); + filenames.push_back(porting::path_userdata + + DIR_DELIM + ".." + DIR_DELIM + "minetest.conf"); #endif for(u32 i=0; iexists("map-dir")) @@ -334,10 +363,10 @@ int main(int argc, char *argv[]) } //try catch(con::PeerNotFoundException &e) { - dstream<