Use warningstream for log messages with WARNING
authorShadowNinja <shadowninja@minetest.net>
Wed, 14 Oct 2015 05:26:03 +0000 (01:26 -0400)
committerkwolekr <kwolekr@minetest.net>
Wed, 14 Oct 2015 05:36:48 +0000 (01:36 -0400)
Remove DTIME macro and its uses, too

26 files changed:
src/ban.cpp
src/clientobject.cpp
src/collision.cpp
src/content_cao.cpp
src/content_nodemeta.cpp
src/database-leveldb.cpp
src/database-redis.cpp
src/database-sqlite3.cpp
src/debug.h
src/environment.cpp
src/guiFormSpecMenu.cpp
src/map.cpp
src/mapblock.cpp
src/mapsector.cpp
src/mods.cpp
src/network/clientpackethandler.cpp
src/network/connection.cpp
src/network/serverpackethandler.cpp
src/nodedef.cpp
src/nodemetadata.cpp
src/nodetimer.cpp
src/porting.cpp
src/server.cpp
src/serverobject.cpp
src/sound_openal.cpp
src/staticobject.h

index 108319953ad069341d193ea086ca507ddde0c031..57b9f49a57aba6f02e33a940cd384d2bbe72fa98 100644 (file)
@@ -36,7 +36,7 @@ BanManager::BanManager(const std::string &banfilepath):
        }
        catch(SerializationError &e)
        {
-               infostream<<"WARNING: BanManager: creating "
+               warningstream<<"BanManager: creating "
                                <<m_banfilepath<<std::endl;
        }
 }
index ae1be092fb601f57c9d08ec1b57ffc1de3387414..a11757ea634829e3b2537a6f9829875247140faf 100644 (file)
@@ -47,7 +47,7 @@ ClientActiveObject* ClientActiveObject::create(ActiveObjectType type,
        n = m_types.find(type);
        if(n == m_types.end()) {
                // If factory is not found, just return.
-               dstream<<"WARNING: ClientActiveObject: No factory for type="
+               warningstream<<"ClientActiveObject: No factory for type="
                                <<(int)type<<std::endl;
                return NULL;
        }
index 5d52202d9b3a7935ca40ff9ec5ad941184834f03..1933302507a5f526965f186237a88cad8b402b09 100644 (file)
@@ -209,7 +209,7 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
                Calculate new velocity
        */
        if( dtime > 0.5 ) {
-               infostream<<"collisionMoveSimple: WARNING: maximum step interval exceeded, lost movement details!"<<std::endl;
+               warningstream<<"collisionMoveSimple: maximum step interval exceeded, lost movement details!"<<std::endl;
                dtime = 0.5;
        }
        speed_f += accel_f * dtime;
@@ -388,7 +388,7 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
                loopcount++;
                if(loopcount >= 100)
                {
-                       infostream<<"collisionMoveSimple: WARNING: Loop count exceeded, aborting to avoid infiniite loop"<<std::endl;
+                       warningstream<<"collisionMoveSimple: Loop count exceeded, aborting to avoid infiniite loop"<<std::endl;
                        dtime = 0;
                        break;
                }
index de06e4d4bfd502d0392b80e1273e4e099090b8ad..27048376449331a578cfb4964fcb1907e033c391 100644 (file)
@@ -465,7 +465,7 @@ void ItemCAO::updateTexture()
        }
        catch(SerializationError &e)
        {
-               infostream<<"WARNING: "<<__FUNCTION_NAME
+               warningstream<<__FUNCTION_NAME
                                <<": error deSerializing itemstring \""
                                <<m_itemstring<<std::endl;
        }
index dd5f8e6b5e80baf485975555a26f86b911707660..072800d6c9c0302597d8fcf1c3e38b7b9e6165ea 100644 (file)
@@ -174,7 +174,7 @@ void content_nodemeta_deserialize_legacy(std::istream &is,
 
                if(meta->get(p) != NULL)
                {
-                       infostream<<"WARNING: "<<__FUNCTION_NAME<<": "
+                       warningstream<<__FUNCTION_NAME<<": "
                                        <<"already set data at position"
                                        <<"("<<p.X<<","<<p.Y<<","<<p.Z<<"): Ignoring."
                                        <<std::endl;
index e895354a4cac2432617ad2e242982872f1819e12..acd0fd1eb7dd3d13edfd4e6b7f845d97f1fbc7b8 100644 (file)
@@ -57,7 +57,7 @@ bool Database_LevelDB::saveBlock(const v3s16 &pos, const std::string &data)
        leveldb::Status status = m_database->Put(leveldb::WriteOptions(),
                        i64tos(getBlockAsInteger(pos)), data);
        if (!status.ok()) {
-               errorstream << "WARNING: saveBlock: LevelDB error saving block "
+               warningstream << "saveBlock: LevelDB error saving block "
                        << PP(pos) << ": " << status.ToString() << std::endl;
                return false;
        }
@@ -82,7 +82,7 @@ bool Database_LevelDB::deleteBlock(const v3s16 &pos)
        leveldb::Status status = m_database->Delete(leveldb::WriteOptions(),
                        i64tos(getBlockAsInteger(pos)));
        if (!status.ok()) {
-               errorstream << "WARNING: deleteBlock: LevelDB error deleting block "
+               warningstream << "deleteBlock: LevelDB error deleting block "
                        << PP(pos) << ": " << status.ToString() << std::endl;
                return false;
        }
index 9e47b516f0b0bfdfc35ba6ff171529ed5ed153bd..b15f546b2ec245c51d308fc3edce7960eae51cd7 100644 (file)
@@ -84,14 +84,14 @@ bool Database_Redis::saveBlock(const v3s16 &pos, const std::string &data)
        redisReply *reply = static_cast<redisReply *>(redisCommand(ctx, "HSET %s %s %b",
                        hash.c_str(), tmp.c_str(), data.c_str(), data.size()));
        if (!reply) {
-               errorstream << "WARNING: saveBlock: redis command 'HSET' failed on "
+               warningstream << "saveBlock: redis command 'HSET' failed on "
                        "block " << PP(pos) << ": " << ctx->errstr << std::endl;
                freeReplyObject(reply);
                return false;
        }
 
        if (reply->type == REDIS_REPLY_ERROR) {
-               errorstream << "WARNING: saveBlock: saving block " << PP(pos)
+               warningstream << "saveBlock: saving block " << PP(pos)
                        << " failed: " << reply->str << std::endl;
                freeReplyObject(reply);
                return false;
@@ -150,7 +150,7 @@ bool Database_Redis::deleteBlock(const v3s16 &pos)
                throw FileNotGoodException(std::string(
                        "Redis command 'HDEL %s %s' failed: ") + ctx->errstr);
        } else if (reply->type == REDIS_REPLY_ERROR) {
-               errorstream << "WARNING: deleteBlock: deleting block " << PP(pos)
+               warningstream << "deleteBlock: deleting block " << PP(pos)
                        << " failed: " << reply->str << std::endl;
                freeReplyObject(reply);
                return false;
index 84b1a712281a3826f387554fd96a829395fdad83..da3e2c86b931ba11d3c3dd57c48ae615dae6e6dd 100644 (file)
@@ -153,7 +153,7 @@ bool Database_SQLite3::deleteBlock(const v3s16 &pos)
        sqlite3_reset(m_stmt_delete);
 
        if (!good) {
-               errorstream << "WARNING: deleteBlock: Block failed to delete "
+               warningstream << "deleteBlock: Block failed to delete "
                        << PP(pos) << ": " << sqlite3_errmsg(m_database) << std::endl;
        }
        return good;
index b7521fec28cdcfc900d2a5649b4beb80a01936ec..94b268eddaa821593e4840526e6a5d3fee9cfcd7 100644 (file)
@@ -89,8 +89,6 @@ __NORETURN extern void sanity_check_fn(
 
 void debug_set_exception_handler();
 
-#define DTIME ""
-
 /*
        DebugStack
 */
index a29b0aab12f6093c7e2fcf8e831cd9cce2a772dc..59159868ec1971b52d669d16cc44dbbf8482503a 100644 (file)
@@ -1188,7 +1188,7 @@ void ServerEnvironment::step(float dtime)
                u32 time_ms = timer.stop(true);
                u32 max_time_ms = 200;
                if(time_ms > max_time_ms){
-                       infostream<<"WARNING: active block modifiers took "
+                       warningstream<<"active block modifiers took "
                                        <<time_ms<<"ms (longer than "
                                        <<max_time_ms<<"ms)"<<std::endl;
                        m_active_block_interval_overload_skip = (time_ms / max_time_ms) + 1;
@@ -1910,7 +1910,7 @@ void ServerEnvironment::deactivateFarObjects(bool force_delete)
                                        // reason. Unsuccessful attempts have been made to find
                                        // said reason.
                                        if(id && block->m_static_objects.m_active.find(id) != block->m_static_objects.m_active.end()){
-                                               infostream<<"ServerEnv: WARNING: Performing hack #83274"
+                                               warningstream<<"ServerEnv: Performing hack #83274"
                                                                <<std::endl;
                                                block->m_static_objects.remove(id);
                                        }
index dca7618b9852f794aadea571cde6db73a7d6eb51..c5edb967eaea1f8c10075aaa9c0f34b1357cae91 100644 (file)
@@ -300,7 +300,7 @@ void GUIFormSpecMenu::parseSize(parserData* data,std::string element)
 void GUIFormSpecMenu::parseList(parserData* data,std::string element)
 {
        if (m_gamedef == 0) {
-               errorstream<<"WARNING: invalid use of 'list' with m_gamedef==0"<<std::endl;
+               warningstream<<"invalid use of 'list' with m_gamedef==0"<<std::endl;
                return;
        }
 
@@ -345,7 +345,7 @@ void GUIFormSpecMenu::parseList(parserData* data,std::string element)
                }
 
                if(!data->explicit_size)
-                       errorstream<<"WARNING: invalid use of list without a size[] element"<<std::endl;
+                       warningstream<<"invalid use of list without a size[] element"<<std::endl;
                m_inventorylists.push_back(ListDrawSpec(loc, listname, pos, geom, start_i));
                return;
        }
@@ -525,7 +525,7 @@ void GUIFormSpecMenu::parseImage(parserData* data,std::string element)
                geom.Y = stof(v_geom[1]) * (float)imgsize.Y;
 
                if(!data->explicit_size)
-                       errorstream<<"WARNING: invalid use of image without a size[] element"<<std::endl;
+                       warningstream<<"invalid use of image without a size[] element"<<std::endl;
                m_images.push_back(ImageDrawSpec(name, pos, geom));
                return;
        }
@@ -541,7 +541,7 @@ void GUIFormSpecMenu::parseImage(parserData* data,std::string element)
                pos.Y += stof(v_pos[1]) * (float) spacing.Y;
 
                if(!data->explicit_size)
-                       errorstream<<"WARNING: invalid use of image without a size[] element"<<std::endl;
+                       warningstream<<"invalid use of image without a size[] element"<<std::endl;
                m_images.push_back(ImageDrawSpec(name, pos));
                return;
        }
@@ -571,7 +571,7 @@ void GUIFormSpecMenu::parseItemImage(parserData* data,std::string element)
                geom.Y = stof(v_geom[1]) * (float)imgsize.Y;
 
                if(!data->explicit_size)
-                       errorstream<<"WARNING: invalid use of item_image without a size[] element"<<std::endl;
+                       warningstream<<"invalid use of item_image without a size[] element"<<std::endl;
                m_itemimages.push_back(ImageDrawSpec(name, pos, geom));
                return;
        }
@@ -607,7 +607,7 @@ void GUIFormSpecMenu::parseButton(parserData* data,std::string element,
                                                pos.X + geom.X, pos.Y + m_btn_height);
 
                if(!data->explicit_size)
-                       errorstream<<"WARNING: invalid use of button without a size[] element"<<std::endl;
+                       warningstream<<"invalid use of button without a size[] element"<<std::endl;
 
                label = unescape_string(label);
 
@@ -666,7 +666,7 @@ void GUIFormSpecMenu::parseBackground(parserData* data,std::string element)
                }
 
                if(!data->explicit_size)
-                       errorstream<<"WARNING: invalid use of background without a size[] element"<<std::endl;
+                       warningstream<<"invalid use of background without a size[] element"<<std::endl;
                m_backgrounds.push_back(ImageDrawSpec(name, pos, geom));
                return;
        }
@@ -982,7 +982,7 @@ void GUIFormSpecMenu::parseSimpleField(parserData* data,
        core::rect<s32> rect;
 
        if(data->explicit_size)
-               errorstream<<"WARNING: invalid use of unpositioned \"field\" in inventory"<<std::endl;
+               warningstream<<"invalid use of unpositioned \"field\" in inventory"<<std::endl;
 
        v2s32 pos = padding + AbsoluteRect.UpperLeftCorner;
        pos.Y = ((m_fields.size()+2)*60);
@@ -1088,7 +1088,7 @@ void GUIFormSpecMenu::parseTextArea(parserData* data,
        core::rect<s32> rect = core::rect<s32>(pos.X, pos.Y, pos.X+geom.X, pos.Y+geom.Y);
 
        if(!data->explicit_size)
-               errorstream<<"WARNING: invalid use of positioned "<<type<<" without a size[] element"<<std::endl;
+               warningstream<<"invalid use of positioned "<<type<<" without a size[] element"<<std::endl;
 
        if(m_form_src)
                default_val = m_form_src->resolveText(default_val);
@@ -1195,7 +1195,7 @@ void GUIFormSpecMenu::parseLabel(parserData* data,std::string element)
                pos.Y += (stof(v_pos[1]) + 7.0/30.0) * (float)spacing.Y;
 
                if(!data->explicit_size)
-                       errorstream<<"WARNING: invalid use of label without a size[] element"<<std::endl;
+                       warningstream<<"invalid use of label without a size[] element"<<std::endl;
 
                text = unescape_string(text);
                std::vector<std::string> lines = split(text, '\n');
@@ -1260,7 +1260,7 @@ void GUIFormSpecMenu::parseVertLabel(parserData* data,std::string element)
                //actually text.length() would be correct but adding +1 avoids to break all mods
 
                if(!data->explicit_size)
-                       errorstream<<"WARNING: invalid use of label without a size[] element"<<std::endl;
+                       warningstream<<"invalid use of label without a size[] element"<<std::endl;
 
                std::wstring label = L"";
 
@@ -1326,7 +1326,7 @@ void GUIFormSpecMenu::parseImageButton(parserData* data,std::string element,
                core::rect<s32> rect = core::rect<s32>(pos.X, pos.Y, pos.X+geom.X, pos.Y+geom.Y);
 
                if(!data->explicit_size)
-                       errorstream<<"WARNING: invalid use of image_button without a size[] element"<<std::endl;
+                       warningstream<<"invalid use of image_button without a size[] element"<<std::endl;
 
                image_name = unescape_string(image_name);
                pressed_image_name = unescape_string(pressed_image_name);
@@ -1449,9 +1449,8 @@ void GUIFormSpecMenu::parseItemImageButton(parserData* data,std::string element)
 {
 
        if (m_gamedef == 0) {
-               errorstream <<
-                               "WARNING: invalid use of item_image_button with m_gamedef==0"
-                               << std::endl;
+               warningstream << "invalid use of item_image_button with m_gamedef==0"
+                       << std::endl;
                return;
        }
 
@@ -1479,7 +1478,7 @@ void GUIFormSpecMenu::parseItemImageButton(parserData* data,std::string element)
                core::rect<s32> rect = core::rect<s32>(pos.X, pos.Y, pos.X+geom.X, pos.Y+geom.Y);
 
                if(!data->explicit_size)
-                       errorstream<<"WARNING: invalid use of item_image_button without a size[] element"<<std::endl;
+                       warningstream<<"invalid use of item_image_button without a size[] element"<<std::endl;
 
                IItemDefManager *idef = m_gamedef->idef();
                ItemStack item;
@@ -2158,7 +2157,7 @@ void GUIFormSpecMenu::drawList(const ListDrawSpec &s, int phase)
 
        Inventory *inv = m_invmgr->getInventory(s.inventoryloc);
        if(!inv){
-               infostream<<"GUIFormSpecMenu::drawList(): WARNING: "
+               warningstream<<"GUIFormSpecMenu::drawList(): "
                                <<"The inventory location "
                                <<"\""<<s.inventoryloc.dump()<<"\" doesn't exist"
                                <<std::endl;
@@ -2166,7 +2165,7 @@ void GUIFormSpecMenu::drawList(const ListDrawSpec &s, int phase)
        }
        InventoryList *ilist = inv->getList(s.listname);
        if(!ilist){
-               infostream<<"GUIFormSpecMenu::drawList(): WARNING: "
+               warningstream<<"GUIFormSpecMenu::drawList(): "
                                <<"The inventory list \""<<s.listname<<"\" @ \""
                                <<s.inventoryloc.dump()<<"\" doesn't exist"
                                <<std::endl;
index 424683d60ead988059c683c6368f4340401a7001..a2dbffe660445be73f551579f87d2c23e17865ca 100644 (file)
@@ -673,7 +673,7 @@ void Map::updateLighting(enum LightBank bank,
 {
        INodeDefManager *nodemgr = m_gamedef->ndef();
 
-       /*m_dout<<DTIME<<"Map::updateLighting(): "
+       /*m_dout<<"Map::updateLighting(): "
                        <<a_blocks.size()<<" blocks."<<std::endl;*/
 
        //TimeTaker timer("updateLighting");
@@ -928,7 +928,7 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n,
        INodeDefManager *ndef = m_gamedef->ndef();
 
        /*PrintInfo(m_dout);
-       m_dout<<DTIME<<"Map::addNodeAndUpdate(): p=("
+       m_dout<<"Map::addNodeAndUpdate(): p=("
                        <<p.X<<","<<p.Y<<","<<p.Z<<")"<<std::endl;*/
 
        /*
@@ -1028,7 +1028,7 @@ void Map::addNodeAndUpdate(v3s16 p, MapNode n,
        {
                s16 y = p.Y - 1;
                for(;; y--){
-                       //m_dout<<DTIME<<"y="<<y<<std::endl;
+                       //m_dout<<"y="<<y<<std::endl;
                        v3s16 n2pos(p.X, y, p.Z);
 
                        MapNode n2;
@@ -1115,7 +1115,7 @@ void Map::removeNodeAndUpdate(v3s16 p,
        INodeDefManager *ndef = m_gamedef->ndef();
 
        /*PrintInfo(m_dout);
-       m_dout<<DTIME<<"Map::removeNodeAndUpdate(): p=("
+       m_dout<<"Map::removeNodeAndUpdate(): p=("
                        <<p.X<<","<<p.Y<<","<<p.Z<<")"<<std::endl;*/
 
        bool node_under_sunlight = true;
@@ -1197,14 +1197,14 @@ void Map::removeNodeAndUpdate(v3s16 p,
        if(node_under_sunlight)
        {
                s16 ybottom = propagateSunlight(p, modified_blocks);
-               /*m_dout<<DTIME<<"Node was under sunlight. "
+               /*m_dout<<"Node was under sunlight. "
                                "Propagating sunlight";
-               m_dout<<DTIME<<" -> ybottom="<<ybottom<<std::endl;*/
+               m_dout<<" -> ybottom="<<ybottom<<std::endl;*/
                s16 y = p.Y;
                for(; y >= ybottom; y--)
                {
                        v3s16 p2(p.X, y, p.Z);
-                       /*m_dout<<DTIME<<"lighting neighbors of node ("
+                       /*m_dout<<"lighting neighbors of node ("
                                        <<p2.X<<","<<p2.Y<<","<<p2.Z<<")"
                                        <<std::endl;*/
                        lightNeighbors(LIGHTBANK_DAY, p2, modified_blocks);
@@ -2018,7 +2018,7 @@ NodeMetadata *Map::getNodeMetadata(v3s16 p)
                block = emergeBlock(blockpos, false);
        }
        if(!block){
-               infostream<<"WARNING: Map::getNodeMetadata(): Block not found"
+               warningstream<<"Map::getNodeMetadata(): Block not found"
                                <<std::endl;
                return NULL;
        }
@@ -2037,7 +2037,7 @@ bool Map::setNodeMetadata(v3s16 p, NodeMetadata *meta)
                block = emergeBlock(blockpos, false);
        }
        if(!block){
-               infostream<<"WARNING: Map::setNodeMetadata(): Block not found"
+               warningstream<<"Map::setNodeMetadata(): Block not found"
                                <<std::endl;
                return false;
        }
@@ -2052,7 +2052,7 @@ void Map::removeNodeMetadata(v3s16 p)
        MapBlock *block = getBlockNoCreateNoEx(blockpos);
        if(block == NULL)
        {
-               infostream<<"WARNING: Map::removeNodeMetadata(): Block not found"
+               warningstream<<"Map::removeNodeMetadata(): Block not found"
                                <<std::endl;
                return;
        }
@@ -2070,7 +2070,7 @@ NodeTimer Map::getNodeTimer(v3s16 p)
                block = emergeBlock(blockpos, false);
        }
        if(!block){
-               infostream<<"WARNING: Map::getNodeTimer(): Block not found"
+               warningstream<<"Map::getNodeTimer(): Block not found"
                                <<std::endl;
                return NodeTimer();
        }
@@ -2089,7 +2089,7 @@ void Map::setNodeTimer(v3s16 p, NodeTimer t)
                block = emergeBlock(blockpos, false);
        }
        if(!block){
-               infostream<<"WARNING: Map::setNodeTimer(): Block not found"
+               warningstream<<"Map::setNodeTimer(): Block not found"
                                <<std::endl;
                return;
        }
@@ -2103,7 +2103,7 @@ void Map::removeNodeTimer(v3s16 p)
        MapBlock *block = getBlockNoCreateNoEx(blockpos);
        if(block == NULL)
        {
-               infostream<<"WARNING: Map::removeNodeTimer(): Block not found"
+               warningstream<<"Map::removeNodeTimer(): Block not found"
                                <<std::endl;
                return;
        }
@@ -2164,7 +2164,7 @@ ServerMap::ServerMap(std::string savedir, IGameDef *gamedef, EmergeManager *emer
                                                          <<" Using default settings."<<std::endl;
                                }
                                catch(FileNotGoodException &e){
-                                       infostream<<"WARNING: Could not load map metadata"
+                                       warningstream<<"Could not load map metadata"
                                                        //<<" Disabling chunk-based generator."
                                                        <<std::endl;
                                        //m_chunksize = 0;
@@ -2188,10 +2188,10 @@ ServerMap::ServerMap(std::string savedir, IGameDef *gamedef, EmergeManager *emer
        }
        catch(std::exception &e)
        {
-               infostream<<"WARNING: ServerMap: Failed to load map from "<<savedir
+               warningstream<<"ServerMap: Failed to load map from "<<savedir
                                <<", exception: "<<e.what()<<std::endl;
                infostream<<"Please remove the map or fix it."<<std::endl;
-               infostream<<"WARNING: Map saving will be disabled."<<std::endl;
+               warningstream<<"Map saving will be disabled."<<std::endl;
        }
 
        infostream<<"Initializing new map."<<std::endl;
@@ -2798,7 +2798,7 @@ void ServerMap::createDirs(std::string path)
 {
        if(fs::CreateAllDirs(path) == false)
        {
-               m_dout<<DTIME<<"ServerMap: Failed to create directory "
+               m_dout<<"ServerMap: Failed to create directory "
                                <<"\""<<path<<"\""<<std::endl;
                throw BaseException("ServerMap failed to create directory");
        }
@@ -2882,7 +2882,7 @@ void ServerMap::save(ModifiedState save_level)
 {
        DSTACK(__FUNCTION_NAME);
        if(m_map_saving_enabled == false) {
-               infostream<<"WARNING: Not saving map, saving disabled."<<std::endl;
+               warningstream<<"Not saving map, saving disabled."<<std::endl;
                return;
        }
 
@@ -3256,7 +3256,7 @@ bool ServerMap::saveBlock(MapBlock *block, Database *db)
 
        // Dummy blocks are not written
        if (block->isDummy()) {
-               errorstream << "WARNING: saveBlock: Not writing dummy block "
+               warningstream << "saveBlock: Not writing dummy block "
                        << PP(p3d) << std::endl;
                return true;
        }
@@ -3346,7 +3346,7 @@ void ServerMap::loadBlock(std::string sectordir, std::string blockfile,
        }
        catch(SerializationError &e)
        {
-               infostream<<"WARNING: Invalid block data on disk "
+               warningstream<<"Invalid block data on disk "
                                <<"fullpath="<<fullpath
                                <<" (SerializationError). "
                                <<"what()="<<e.what()
index 942457407494f5b70003b81b1a1d3e53b8fb6d3b..be16c3bb72f748061826812cca525b1ae9db6e8f 100644 (file)
@@ -707,7 +707,7 @@ void MapBlock::deSerialize(std::istream &is, u8 version, bool disk)
                                &m_node_metadata, &m_node_timers,
                                m_gamedef->idef());
        } catch(SerializationError &e) {
-               errorstream<<"WARNING: MapBlock::deSerialize(): Ignoring an error"
+               warningstream<<"MapBlock::deSerialize(): Ignoring an error"
                                <<" while deserializing node metadata at ("
                                <<PP(getPos())<<": "<<e.what()<<std::endl;
        }
@@ -770,7 +770,7 @@ void MapBlock::deSerializeNetworkSpecific(std::istream &is)
        }
        catch(SerializationError &e)
        {
-               errorstream<<"WARNING: MapBlock::deSerializeNetworkSpecific(): Ignoring an error"
+               warningstream<<"MapBlock::deSerializeNetworkSpecific(): Ignoring an error"
                                <<": "<<e.what()<<std::endl;
        }
 }
@@ -797,12 +797,12 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
                is.read(&tmp, 1);
                if (is.gcount() != 1)
                        throw SerializationError(std::string(__FUNCTION_NAME)
-                               + ": no enough input data");
+                               + ": not enough input data");
                is_underground = tmp;
                is.read((char *)*databuf_nodelist, nodecount * ser_length);
                if ((u32)is.gcount() != nodecount * ser_length)
                        throw SerializationError(std::string(__FUNCTION_NAME)
-                               + ": no enough input data");
+                               + ": not enough input data");
        } else if (version <= 10) {
                u8 t8;
                is.read((char *)&t8, 1);
@@ -815,7 +815,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
                        std::string s = os.str();
                        if (s.size() != nodecount)
                                throw SerializationError(std::string(__FUNCTION_NAME)
-                                       + ": no enough input data");
+                                       + ": not enough input data");
                        for (u32 i = 0; i < s.size(); i++) {
                                databuf_nodelist[i*ser_length] = s[i];
                        }
@@ -827,7 +827,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
                        std::string s = os.str();
                        if (s.size() != nodecount)
                                throw SerializationError(std::string(__FUNCTION_NAME)
-                                       + ": no enough input data");
+                                       + ": not enough input data");
                        for (u32 i = 0; i < s.size(); i++) {
                                databuf_nodelist[i*ser_length + 1] = s[i];
                        }
@@ -840,7 +840,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
                        std::string s = os.str();
                        if (s.size() != nodecount)
                                throw SerializationError(std::string(__FUNCTION_NAME)
-                                       + ": no enough input data");
+                                       + ": not enough input data");
                        for (u32 i = 0; i < s.size(); i++) {
                                databuf_nodelist[i*ser_length + 2] = s[i];
                        }
@@ -891,7 +891,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
                                                m_gamedef->idef());
                                }
                        } catch(SerializationError &e) {
-                               errorstream<<"WARNING: MapBlock::deSerialize(): Ignoring an error"
+                               warningstream<<"MapBlock::deSerialize(): Ignoring an error"
                                                <<" while deserializing node metadata"<<std::endl;
                        }
                }
@@ -910,7 +910,7 @@ void MapBlock::deSerialize_pre22(std::istream &is, u8 version, bool disk)
                        u16 count = readU16(is);
                        // Not supported and length not known if count is not 0
                        if(count != 0){
-                               errorstream<<"WARNING: MapBlock::deSerialize_pre22(): "
+                               warningstream<<"MapBlock::deSerialize_pre22(): "
                                                <<"Ignoring stuff coming at and after MBOs"<<std::endl;
                                return;
                        }
index 9ce3c8eb321666204a3a288fe1e9701c2eccd132..1588a5962b6a2f02529e395383e2e52507f0cab6 100644 (file)
@@ -220,7 +220,7 @@ ServerMapSector* ServerMapSector::deSerialize(
 
        if(n != sectors.end())
        {
-               dstream<<"WARNING: deSerializing existent sectors not supported "
+               warningstream<<"deSerializing existent sectors not supported "
                                "at the moment, because code hasn't been tested."
                                <<std::endl;
 
index a81dd46045d48fdc7d66ce6875052f9fd451723a..90e0816d9014a8b237decad5bb8c859470b3ab6f 100644 (file)
@@ -256,7 +256,7 @@ void ModConfiguration::addMods(std::vector<ModSpec> new_mods)
                                // BAD CASE: name conflict in different levels.
                                u32 oldindex = existing_mods[mod.name];
                                const ModSpec &oldmod = m_unsatisfied_mods[oldindex];
-                               actionstream<<"WARNING: Mod name conflict detected: \""
+                               warningstream<<"Mod name conflict detected: \""
                                        <<mod.name<<"\""<<std::endl
                                        <<"Will not load: "<<oldmod.path<<std::endl
                                        <<"Overridden by: "<<mod.path<<std::endl;
@@ -270,7 +270,7 @@ void ModConfiguration::addMods(std::vector<ModSpec> new_mods)
                                // VERY BAD CASE: name conflict in the same level.
                                u32 oldindex = existing_mods[mod.name];
                                const ModSpec &oldmod = m_unsatisfied_mods[oldindex];
-                               errorstream<<"WARNING: Mod name conflict detected: \""
+                               warningstream<<"Mod name conflict detected: \""
                                        <<mod.name<<"\""<<std::endl
                                        <<"Will not load: "<<oldmod.path<<std::endl
                                        <<"Will not load: "<<mod.path<<std::endl;
index d49c9602983c48db119222f78b9b138ebad9a4a6..a49bbe1675fb3c33d39c70c0fc653471b7edc2b7 100644 (file)
@@ -579,7 +579,7 @@ void Client::handleCommand_MovePlayer(NetworkPacket* pkt)
 
 void Client::handleCommand_PlayerItem(NetworkPacket* pkt)
 {
-       infostream << "Client: WARNING: Ignoring TOCLIENT_PLAYERITEM" << std::endl;
+       warningstream << "Client: Ignoring TOCLIENT_PLAYERITEM" << std::endl;
 }
 
 void Client::handleCommand_DeathScreen(NetworkPacket* pkt)
@@ -711,7 +711,7 @@ void Client::handleCommand_Media(NetworkPacket* pkt)
 
 void Client::handleCommand_ToolDef(NetworkPacket* pkt)
 {
-       infostream << "Client: WARNING: Ignoring TOCLIENT_TOOLDEF" << std::endl;
+       warningstream << "Client: Ignoring TOCLIENT_TOOLDEF" << std::endl;
 }
 
 void Client::handleCommand_NodeDef(NetworkPacket* pkt)
@@ -738,7 +738,7 @@ void Client::handleCommand_NodeDef(NetworkPacket* pkt)
 
 void Client::handleCommand_CraftItemDef(NetworkPacket* pkt)
 {
-       infostream << "Client: WARNING: Ignoring TOCLIENT_CRAFTITEMDEF" << std::endl;
+       warningstream << "Client: Ignoring TOCLIENT_CRAFTITEMDEF" << std::endl;
 }
 
 void Client::handleCommand_ItemDef(NetworkPacket* pkt)
index d73d4ba17f7aba9671545c0f157d2ade54f692a7..0738c6a1f3703f30e2e67759d3eeb147aa62432b 100644 (file)
@@ -2099,6 +2099,7 @@ void * ConnectionReceiveThread::run()
 #endif
                END_DEBUG_EXCEPTION_HANDLER(errorstream);
        }
+
        PROFILE(g_profiler->remove(ThreadIdentifier.str()));
        return NULL;
 }
index 0bf7e4769166e65dc6081148713cf572d3e53903..d9ff564da924f03d890d4295a641f0de5f1a4dae 100644 (file)
@@ -1713,7 +1713,7 @@ void Server::handleCommand_Interact(NetworkPacket* pkt)
                Catch invalid actions
        */
        else {
-               infostream << "WARNING: Server: Invalid action "
+               warningstream << "Server: Invalid action "
                                << action << std::endl;
        }
 }
index 5a1578bba589f416fd0f26770b648df6f501a82f..b5ccc3b94e94521a0a2912bab773c68c684644b5 100644 (file)
@@ -653,7 +653,7 @@ content_t CNodeDefManager::set(const std::string &name, const ContentFeatures &d
 
        // Don't allow redefining ignore (but allow air and unknown)
        if (name == "ignore") {
-               infostream << "NodeDefManager: WARNING: Ignoring "
+               warningstream << "NodeDefManager: Ignoring "
                        "CONTENT_IGNORE redefinition"<<std::endl;
                return CONTENT_IGNORE;
        }
@@ -663,7 +663,7 @@ content_t CNodeDefManager::set(const std::string &name, const ContentFeatures &d
                // Get new id
                id = allocateId();
                if (id == CONTENT_IGNORE) {
-                       infostream << "NodeDefManager: WARNING: Absolute "
+                       warningstream << "NodeDefManager: Absolute "
                                "limit reached" << std::endl;
                        return CONTENT_IGNORE;
                }
@@ -1112,12 +1112,12 @@ void CNodeDefManager::deSerialize(std::istream &is)
 
                // Check error conditions
                if (i == CONTENT_IGNORE || i == CONTENT_AIR || i == CONTENT_UNKNOWN) {
-                       infostream << "NodeDefManager::deSerialize(): WARNING: "
+                       warningstream << "NodeDefManager::deSerialize(): "
                                "not changing builtin node " << i << std::endl;
                        continue;
                }
                if (f.name == "") {
-                       infostream << "NodeDefManager::deSerialize(): WARNING: "
+                       warningstream << "NodeDefManager::deSerialize(): "
                                "received empty name" << std::endl;
                        continue;
                }
@@ -1125,7 +1125,7 @@ void CNodeDefManager::deSerialize(std::istream &is)
                // Ignore aliases
                u16 existing_id;
                if (m_name_id_mapping.getId(f.name, existing_id) && i != existing_id) {
-                       infostream << "NodeDefManager::deSerialize(): WARNING: "
+                       warningstream << "NodeDefManager::deSerialize(): "
                                "already defined with different ID: " << f.name << std::endl;
                        continue;
                }
index d63dac6966432c9447628eafb9c855cec94ad34d..9c74dcd28cdb4616a28c6475ccd352f124e7d7e4 100644 (file)
@@ -139,7 +139,7 @@ void NodeMetadataList::deSerialize(std::istream &is, IItemDefManager *item_def_m
                p.X = p16;
 
                if (m_data.find(p) != m_data.end()) {
-                       infostream<<"WARNING: NodeMetadataList::deSerialize(): "
+                       warningstream<<"NodeMetadataList::deSerialize(): "
                                        <<"already set data at position"
                                        <<"("<<p.X<<","<<p.Y<<","<<p.Z<<"): Ignoring."
                                        <<std::endl;
index 1feefa203a5981549e1009702d0843cab14e493d..35094054691da236e30e0369af5046f9a3f1407d 100644 (file)
@@ -108,7 +108,7 @@ void NodeTimerList::deSerialize(std::istream &is, u8 map_format_version)
 
                if(t.timeout <= 0)
                {
-                       infostream<<"WARNING: NodeTimerList::deSerialize(): "
+                       warningstream<<"NodeTimerList::deSerialize(): "
                                        <<"invalid data at position"
                                        <<"("<<p.X<<","<<p.Y<<","<<p.Z<<"): Ignoring."
                                        <<std::endl;
@@ -117,7 +117,7 @@ void NodeTimerList::deSerialize(std::istream &is, u8 map_format_version)
 
                if(m_data.find(p) != m_data.end())
                {
-                       infostream<<"WARNING: NodeTimerList::deSerialize(): "
+                       warningstream<<"NodeTimerList::deSerialize(): "
                                        <<"already set data at position"
                                        <<"("<<p.X<<","<<p.Y<<","<<p.Z<<"): Ignoring."
                                        <<std::endl;
index d0dfc801fcbd5e47957a52f163f66f0ff1cf73b2..ced41d4fb748083e0886440661620ece2498bf89 100644 (file)
@@ -75,13 +75,13 @@ bool * signal_handler_killstatus(void)
 
 void sigint_handler(int sig)
 {
-       if(!g_killed) {
-               dstream<<DTIME<<"INFO: sigint_handler(): "
-                               <<"Ctrl-C pressed, shutting down."<<std::endl;
+       if (!g_killed) {
+               dstream << "INFO: sigint_handler(): "
+                       << "Ctrl-C pressed, shutting down." << std::endl;
 
                // Comment out for less clutter when testing scripts
-               /*dstream<<DTIME<<"INFO: sigint_handler(): "
-                               <<"Printing debug stacks"<<std::endl;
+               /*dstream << "INFO: sigint_handler(): "
+                               << "Printing debug stacks" << std::endl;
                debug_stacks_print();*/
 
                g_killed = true;
@@ -105,8 +105,8 @@ BOOL WINAPI event_handler(DWORD sig)
        case CTRL_CLOSE_EVENT:
        case CTRL_LOGOFF_EVENT:
        case CTRL_SHUTDOWN_EVENT:
-               if (g_killed == false) {
-                       dstream << DTIME << "INFO: event_handler(): "
+               if (!g_killed) {
+                       dstream << "INFO: event_handler(): "
                                << "Ctrl+C, Close Event, Logoff Event or Shutdown Event,"
                                " shutting down." << std::endl;
                        g_killed = true;
@@ -401,14 +401,14 @@ bool setSystemPaths()
                const std::string &trypath = *i;
                if (!fs::PathExists(trypath) ||
                        !fs::PathExists(trypath + DIR_DELIM + "builtin")) {
-                       dstream << "WARNING: system-wide share not found at \""
+                       warningstream << "system-wide share not found at \""
                                        << trypath << "\""<< std::endl;
                        continue;
                }
 
                // Warn if was not the first alternative
                if (i != trylist.begin()) {
-                       dstream << "WARNING: system-wide share found at \""
+                       warningstream << "system-wide share found at \""
                                        << trypath << "\"" << std::endl;
                }
 
@@ -437,7 +437,7 @@ bool setSystemPaths()
                        TRUE, (UInt8 *)path, PATH_MAX)) {
                path_share = std::string(path);
        } else {
-               dstream << "WARNING: Could not determine bundle resource path" << std::endl;
+               warningstream << "Could not determine bundle resource path" << std::endl;
        }
        CFRelease(resources_url);
 
index b0f69f1c384fc472badeac8fe6ae2abf0400f6bd..8f105ffd2757071b30bb0797ed831e211c927f07 100644 (file)
@@ -693,7 +693,7 @@ void Server::AsyncRunStep(bool initial_step)
                        Player *player = m_env->getPlayer(client->peer_id);
                        if(player == NULL) {
                                // This can happen if the client timeouts somehow
-                               /*infostream<<"WARNING: "<<__FUNCTION_NAME<<": Client "
+                               /*warningstream<<__FUNCTION_NAME<<": Client "
                                                <<client->peer_id
                                                <<" has no associated player"<<std::endl;*/
                                continue;
@@ -746,7 +746,7 @@ void Server::AsyncRunStep(bool initial_step)
                                // Get object type
                                u8 type = ACTIVEOBJECT_TYPE_INVALID;
                                if(obj == NULL)
-                                       infostream<<"WARNING: "<<__FUNCTION_NAME
+                                       warningstream<<__FUNCTION_NAME
                                                        <<": NULL object"<<std::endl;
                                else
                                        type = obj->getSendType();
@@ -931,7 +931,7 @@ void Server::AsyncRunStep(bool initial_step)
                                break;
                        default:
                                prof.add("unknown", 1);
-                               infostream << "WARNING: Server: Unknown MapEditEvent "
+                               warningstream << "Server: Unknown MapEditEvent "
                                                << ((u32)event->type) << std::endl;
                                break;
                        }
index 699040bf2599a42716aa4dd0ec471c39183042e8..236d7e8dc06feaaca81fedb4c3479fc87ed3d103 100644 (file)
@@ -52,7 +52,7 @@ ServerActiveObject* ServerActiveObject::create(ActiveObjectType type,
                }
 
                // If factory is not found, just return.
-               dstream<<"WARNING: ServerActiveObject: No factory for type="
+               warningstream<<"ServerActiveObject: No factory for type="
                                <<type<<std::endl;
                return NULL;
        }
index 195775396a9589039d67b838b1d142e67e443a3b..df316fbf0ff6f52bc7e9cb53d7bf277e152b8391 100644 (file)
@@ -92,7 +92,7 @@ static ALenum warn_if_error(ALenum err, const char *desc)
 {
        if(err == AL_NO_ERROR)
                return err;
-       errorstream<<"WARNING: "<<desc<<": "<<alErrorString(err)<<std::endl;
+       warningstream<<desc<<": "<<alErrorString(err)<<std::endl;
        return err;
 }
 
index 95a1b945ee040bc8c90741e879ba314a2c24d285..208fb2cc86caf387cf1d9292d06e650d73892a9a 100644 (file)
@@ -79,7 +79,7 @@ public:
                assert(id != 0); // Pre-condition
                if(m_active.find(id) == m_active.end())
                {
-                       dstream<<"WARNING: StaticObjectList::remove(): id="<<id
+                       warningstream<<"StaticObjectList::remove(): id="<<id
                                        <<" not found"<<std::endl;
                        return;
                }