diff options
Diffstat (limited to 'src/example')
| -rw-r--r-- | src/example/audio_internal.cpp | 4 | ||||
| -rw-r--r-- | src/example/components_internal.cpp | 2 | ||||
| -rw-r--r-- | src/example/db.cpp | 8 | ||||
| -rw-r--r-- | src/example/log.cpp | 12 | ||||
| -rw-r--r-- | src/example/proxy.cpp | 9 | ||||
| -rw-r--r-- | src/example/rendering.cpp | 2 | ||||
| -rw-r--r-- | src/example/savemgr.cpp | 16 | ||||
| -rw-r--r-- | src/example/script.cpp | 6 | 
8 files changed, 29 insertions, 30 deletions
diff --git a/src/example/audio_internal.cpp b/src/example/audio_internal.cpp index 1ea839d..ff55a59 100644 --- a/src/example/audio_internal.cpp +++ b/src/example/audio_internal.cpp @@ -5,7 +5,7 @@  #include <crepe/api/Config.h>  #include <crepe/facade/Sound.h> -#include <crepe/util/log.h> +#include <crepe/util/Log.h>  #include <thread> @@ -18,7 +18,7 @@ using std::make_unique;  int _ = []() {  	// Show dbg_trace() output  	auto & cfg = Config::get_instance(); -	cfg.log.level = LogLevel::TRACE; +	cfg.log.level = Log::Level::TRACE;  	return 0; // satisfy compiler  }(); diff --git a/src/example/components_internal.cpp b/src/example/components_internal.cpp index ea1eaad..f7e395b 100644 --- a/src/example/components_internal.cpp +++ b/src/example/components_internal.cpp @@ -13,7 +13,7 @@  #include <crepe/api/Rigidbody.h>  #include <crepe/api/Sprite.h> -#include <crepe/util/log.h> +#include <crepe/util/Log.h>  using namespace crepe;  using namespace std; diff --git a/src/example/db.cpp b/src/example/db.cpp index 8c06a84..ee4e8fc 100644 --- a/src/example/db.cpp +++ b/src/example/db.cpp @@ -1,6 +1,6 @@  #include <crepe/api/Config.h>  #include <crepe/facade/DB.h> -#include <crepe/util/log.h> +#include <crepe/util/Log.h>  using namespace crepe;  using namespace std; @@ -8,7 +8,7 @@ using namespace std;  // run before main  static auto _ = []() {  	auto & cfg = Config::get_instance(); -	cfg.log.level = LogLevel::TRACE; +	cfg.log.level = Log::Level::TRACE;  	return 0;  }(); @@ -20,11 +20,11 @@ int main() {  	const char * test_key = "test-key";  	string test_data = "Hello world!"; -	dbg_logf("DB has key = %d", db.has(test_key)); +	dbg_logf("DB has key = {}", db.has(test_key));  	db.set(test_key, test_data); -	dbg_logf("key = \"%s\"", db.get(test_key).c_str()); +	dbg_logf("key = \"{}\"", db.get(test_key));  	return 0;  } diff --git a/src/example/log.cpp b/src/example/log.cpp index db8aa48..5baa021 100644 --- a/src/example/log.cpp +++ b/src/example/log.cpp @@ -4,7 +4,7 @@   */  #include <crepe/api/Config.h> -#include <crepe/util/log.h> +#include <crepe/util/Log.h>  using namespace crepe; @@ -12,17 +12,17 @@ using namespace crepe;  int _ = []() {  	// make sure all log messages get printed  	auto & cfg = Config::get_instance(); -	cfg.log.level = LogLevel::TRACE; +	cfg.log.level = Log::Level::TRACE;  	return 0; // satisfy compiler  }();  int main() {  	dbg_trace(); -	dbg_logf("test printf parameters: %d", 3); -	logf(LogLevel::INFO, "info message"); -	logf(LogLevel::WARNING, "warning"); -	logf(LogLevel::ERROR, "error"); +	dbg_log("debug message"); +	Log::logf("info message with variable: {}", 3); +	Log::logf(Log::Level::WARNING, "warning"); +	Log::logf(Log::Level::ERROR, "error");  	return 0;  } diff --git a/src/example/proxy.cpp b/src/example/proxy.cpp index 0afff41..69451f8 100644 --- a/src/example/proxy.cpp +++ b/src/example/proxy.cpp @@ -5,8 +5,8 @@  #include <crepe/ValueBroker.h>  #include <crepe/api/Config.h> +#include <crepe/util/Log.h>  #include <crepe/util/Proxy.h> -#include <crepe/util/log.h>  using namespace std;  using namespace crepe; @@ -17,18 +17,17 @@ void test_ro_val(int val) {}  int main() {  	auto & cfg = Config::get_instance(); -	cfg.log.level = LogLevel::DEBUG; +	cfg.log.level = Log::Level::DEBUG;  	int real_value = 0;  	ValueBroker<int> broker{  		[&real_value](const int & target) { -			dbg_logf("set %s to %s", to_string(real_value).c_str(), -					 to_string(target).c_str()); +			dbg_logf("set {} to {}", real_value, target);  			real_value = target;  		},  		[&real_value]() -> const int & { -			dbg_logf("get %s", to_string(real_value).c_str()); +			dbg_logf("get {}", real_value);  			return real_value;  		},  	}; diff --git a/src/example/rendering.cpp b/src/example/rendering.cpp index e02f6a3..ae21f9a 100644 --- a/src/example/rendering.cpp +++ b/src/example/rendering.cpp @@ -2,7 +2,7 @@  #include <crepe/ComponentManager.h>  #include <crepe/api/GameObject.h>  #include <crepe/system/RenderSystem.h> -#include <crepe/util/log.h> +#include <crepe/util/Log.h>  #include <crepe/api/AssetManager.h>  #include <crepe/api/Color.h> diff --git a/src/example/savemgr.cpp b/src/example/savemgr.cpp index 436fb5a..65c4a34 100644 --- a/src/example/savemgr.cpp +++ b/src/example/savemgr.cpp @@ -6,8 +6,8 @@  #include <cassert>  #include <crepe/api/Config.h>  #include <crepe/api/SaveManager.h> +#include <crepe/util/Log.h>  #include <crepe/util/Proxy.h> -#include <crepe/util/log.h>  using namespace crepe; @@ -15,7 +15,7 @@ using namespace crepe;  int _ = []() {  	// make sure all log messages get printed  	auto & cfg = Config::get_instance(); -	cfg.log.level = LogLevel::TRACE; +	cfg.log.level = Log::Level::TRACE;  	return 0; // satisfy compiler  }(); @@ -25,19 +25,19 @@ int main() {  	SaveManager & mgr = SaveManager::get_instance(); -	dbg_logf("has key = %s", mgr.has(key) ? "true" : "false"); +	dbg_logf("has key = {}", mgr.has(key));  	ValueBroker<int> prop = mgr.get<int>(key, 0);  	Proxy<int> val = mgr.get<int>(key, 0); -	dbg_logf("val = %d", mgr.get<int>(key).get()); +	dbg_logf("val = {}", mgr.get<int>(key).get());  	prop.set(1); -	dbg_logf("val = %d", mgr.get<int>(key).get()); +	dbg_logf("val = {}", mgr.get<int>(key).get());  	val = 2; -	dbg_logf("val = %d", mgr.get<int>(key).get()); +	dbg_logf("val = {}", mgr.get<int>(key).get());  	mgr.set<int>(key, 3); -	dbg_logf("val = %d", mgr.get<int>(key).get()); +	dbg_logf("val = {}", mgr.get<int>(key).get()); -	dbg_logf("has key = %s", mgr.has(key) ? "true" : "false"); +	dbg_logf("has key = {}", mgr.has(key));  	assert(true == mgr.has(key));  	return 0; diff --git a/src/example/script.cpp b/src/example/script.cpp index 9e8b147..d1388b5 100644 --- a/src/example/script.cpp +++ b/src/example/script.cpp @@ -5,7 +5,7 @@  #include <crepe/ComponentManager.h>  #include <crepe/system/ScriptSystem.h> -#include <crepe/util/log.h> +#include <crepe/util/Log.h>  #include <crepe/api/BehaviorScript.h>  #include <crepe/api/Config.h> @@ -20,7 +20,7 @@ using namespace std;  int _ = []() {  	// Show dbg_trace() output  	auto & cfg = Config::get_instance(); -	cfg.log.level = LogLevel::TRACE; +	cfg.log.level = Log::Level::TRACE;  	return 0; // satisfy compiler  }(); @@ -30,7 +30,7 @@ class MyScript : public Script {  	void update() {  		// Retrieve component from the same GameObject this script is on  		Transform & test = get_component<Transform>(); -		dbg_logf("Transform(%.2f, %.2f)", test.position.x, test.position.y); +		dbg_logf("Transform({:.2f}, {:.2f})", test.position.x, test.position.y);  	}  };  |