rename namespace Log to logging (#27)

This commit is contained in:
F1ssi0N 2018-03-23 10:39:56 +00:00 committed by GitHub
parent c3404b5ef4
commit a5059056e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 16 deletions

View File

@ -32,13 +32,13 @@ public:
static bool init_happened = false; static bool init_happened = false;
if (init_happened) return true; if (init_happened) return true;
Log::msg("init()"); logging::msg("init()");
init_happened = true; init_happened = true;
return true; return true;
} }
void post_init() override { void post_init() override {
Log::msg("post_init()"); logging::msg("post_init()");
// Get interfaces here before init_all has a chance to do anything // Get interfaces here before init_all has a chance to do anything
@ -110,7 +110,7 @@ public:
std::this_thread::yield(); std::this_thread::yield();
} }
Log::msg("process_attach()"); logging::msg("process_attach()");
// make sure that the netvars are initialised // make sure that the netvars are initialised
// becuase their dynamic initialiser could be after the // becuase their dynamic initialiser could be after the
@ -130,9 +130,9 @@ public:
void shutdown() override {} void shutdown() override {}
void level_init_pre_entity() override { Log::msg("init_pre_entity()"); } void level_init_pre_entity() override { logging::msg("init_pre_entity()"); }
void level_init_post_entity() override { void level_init_post_entity() override {
Log::msg("level_init_post_entity"); logging::msg("level_init_post_entity");
// Make sure that all our class_ids are correct // Make sure that all our class_ids are correct
// This will only do anything on debug builds and not on release builds. // This will only do anything on debug builds and not on release builds.
@ -143,14 +143,14 @@ public:
// Do level init here // Do level init here
create_move::level_init(); create_move::level_init();
} }
auto level_shutdown_pre_clear_steam_api_context() -> void override { Log::msg("level_shutdown_pre_clear_steam_api_context"); } auto level_shutdown_pre_clear_steam_api_context() -> void override { logging::msg("level_shutdown_pre_clear_steam_api_context"); }
auto level_shutdown_pre_entity() -> void override { auto level_shutdown_pre_entity() -> void override {
Log::msg("level_shutdown_pre_entity"); logging::msg("level_shutdown_pre_entity");
// Do level_shutdown here // Do level_shutdown here
create_move::level_shutdown(); create_move::level_shutdown();
} }
auto level_shutdown_post_entity() -> void override { Log::msg("level_shutdown_post_entity"); } auto level_shutdown_post_entity() -> void override { logging::msg("level_shutdown_post_entity"); }
// update is called from CHLClient_HudUpdate // update is called from CHLClient_HudUpdate
// in theory we should be able to render here // in theory we should be able to render here

View File

@ -80,14 +80,14 @@ bool hooked_create_move(void *instance, float sample_framerate, UserCmd *user_cm
} }
void level_init() { void level_init() {
Log::msg("=> Hooking up!"); logging::msg("=> Hooking up!");
assert(create_move_hook == nullptr); assert(create_move_hook == nullptr);
create_move_hook = new hooks::HookFunction<ClientMode, 0>(IFace<ClientMode>().get(), 21, 22, 22, reinterpret_cast<void *>(&hooked_create_move)); create_move_hook = new hooks::HookFunction<ClientMode, 0>(IFace<ClientMode>().get(), 21, 22, 22, reinterpret_cast<void *>(&hooked_create_move));
} }
void level_shutdown() { void level_shutdown() {
Log::msg("<= Deleting hooks"); logging::msg("<= Deleting hooks");
delete create_move_hook; delete create_move_hook;
create_move_hook = nullptr; create_move_hook = nullptr;

View File

@ -33,12 +33,12 @@ bool internal_checker::ClassIDChecker::check_correct() {
auto found_value = find_class_id(name); auto found_value = find_class_id(name);
if (found_value == -1) { if (found_value == -1) {
Log::msg("[ClassID] Unable to find correct value for '%s'", name); logging::msg("[ClassID] Unable to find correct value for '%s'", name);
return false; return false;
} }
if (found_value != intended_value) { if (found_value != intended_value) {
Log::msg("[ClassID] value for %s is wrong (wanted %d, got %d)", name, intended_value, found_value); logging::msg("[ClassID] value for %s is wrong (wanted %d, got %d)", name, intended_value, found_value);
return false; return false;
} }

View File

@ -295,7 +295,7 @@ void ConvarBase::tf_convar_changed(sdk::IConVar *iconvar, const char *old_string
if (was_clamped) convar->set_value(modifiable->to_string()); if (was_clamped) convar->set_value(modifiable->to_string());
convar->change_callback = callback_backup; convar->change_callback = callback_backup;
Log::msg("Updated convar %s to '%s' (%s)", convar->get_name(), convar->value_string, was_clamped ? "clamped" : "not clamped"); logging::msg("Updated convar %s to '%s' (%s)", convar->get_name(), convar->value_string, was_clamped ? "clamped" : "not clamped");
} }
} }
} }

View File

@ -3,7 +3,7 @@
#include "log.hh" #include "log.hh"
#include "signature.hh" #include "signature.hh"
auto Log::msg(const char *format, ...) -> void { auto logging::msg(const char *format, ...) -> void {
char buffer[1024]; char buffer[1024];
va_list vlist; va_list vlist;

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
namespace Log { namespace logging {
void msg(const char *format, ...); void msg(const char *format, ...);
} }

View File

@ -60,7 +60,7 @@ uptr Netvar::Tree::find_offset(std::vector<const char *> t) {
if (nodes == old_nodes) { if (nodes == old_nodes) {
// TODO: // TODO:
//Log::msg("[Netvar] Unable to find '%s'", name); //logging::msg("[Netvar] Unable to find '%s'", name);
} }
} }