-
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 69b6b9e Author: Joe Morton <jmorton06@live.co.uk> Date: Tue May 19 10:42:27 2020 +0100 Windows build fix spdlog update removed a nominmax define commit 72f3546 Author: Joe Morton <jmorton06@live.co.uk> Date: Mon May 18 22:47:38 2020 +0100 Test update commit cb5d80c Author: Joe Morton <jmorton06@live.co.uk> Date: Mon May 18 22:09:52 2020 +0100 DebugRender refactor commit 7c516ee Author: Joe Morton <jmorton06@live.co.uk> Date: Mon May 18 22:09:35 2020 +0100 Environment class Use ecs for skybox commit 675dcd1 Author: Joe Morton <jmorton06@live.co.uk> Date: Mon May 18 22:08:26 2020 +0100 Resize Fixes Resize gbuffer not delete and create commit a1a0648 Author: Joe Morton <jmorton06@live.co.uk> Date: Mon May 18 22:03:14 2020 +0100 Updated spdlog to 1.6.0 commit 3a7852d Author: Joe Morton <jmorton06@live.co.uk> Date: Thu May 14 23:38:16 2020 +0100 Squashed commit of the following: commit fd76746 Author: Joe Morton <jmorton06@live.co.uk> Date: Thu May 14 23:37:17 2020 +0100 Refactor + bug fixes commit 149db98 Author: Joe Morton <jmorton06@live.co.uk> Date: Mon May 11 22:45:41 2020 +0100 Lua progress + glfw update commit 7e7c2a4 Author: Joe Morton <jmorton06@live.co.uk> Date: Sun May 10 10:42:13 2020 +0100 Windows build fix commit cf2ce42 Author: Joe Morton <jmorton06@live.co.uk> Date: Sat May 9 22:42:22 2020 +0100 Lua progress + Camera controllers Updated imFileBrowser commit 153a481 Author: Joe Morton <jmorton06@live.co.uk> Date: Tue May 5 21:59:55 2020 +0100 Editor / Debug renderer improvements commit 4555cc9 Author: Joe Morton <jmorton06@live.co.uk> Date: Thu Apr 30 18:40:16 2020 +0100 Debug Renderer + Refactor commit 9b7f75c Merge: 65ddb1a 31d630f Author: jmorton06 <jmorton06@live.co.uk> Date: Sun Apr 26 15:31:32 2020 +0100 Lua Progress commit 65ddb1a Merge: 28053bc db980d0 Author: jmorton06 <jmorton06@live.co.uk> Date: Sat Apr 4 21:02:59 2020 +0100 Merge pull request #56 from jmorton06/dev Fix Xcode project warnings commit 28053bc Merge: 1bd59b8 6b2a672 Author: jmorton06 <jmorton06@live.co.uk> Date: Thu Mar 26 22:27:45 2020 +0000 Merge pull request #55 from jmorton06/dev iOS progress and refactor commit 1bd59b8 Merge: beab295 4364007 Author: jmorton06 <jmorton06@live.co.uk> Date: Thu Mar 12 09:08:55 2020 +0000 iOS Progress commit beab295 Merge: 3a19fc5 d3bd0e0 Author: jmorton06 <jmorton06@live.co.uk> Date: Tue Feb 11 11:29:52 2020 +0000 iOS Progress Todo : input / window size commit 3a19fc5 Merge: cb85afe 17fd269 Author: jmorton06 <jmorton06@live.co.uk> Date: Wed Jan 22 21:44:13 2020 +0000 Merge pull request #50 from jmorton06/dev Readme update commit cb85afe Merge: 4a1e291 5b4bebe Author: jmorton06 <jmorton06@live.co.uk> Date: Mon Jan 20 18:48:34 2020 +0000 Merge pull request #49 from jmorton06/dev Update readme commit 4a1e291 Merge: 0859d92 493898c Author: jmorton06 <jmorton06@live.co.uk> Date: Fri Jan 17 08:56:48 2020 +0000 iOS progress merge from dev commit 0859d92 Merge: 22a1690 67b00c2 Author: jmorton06 <jmorton06@live.co.uk> Date: Thu Dec 5 18:45:54 2019 +0000 Merge pull request #43 from jmorton06/dev Improved 3D grid
- Loading branch information
Showing
144 changed files
with
14,328 additions
and
9,594 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. | ||
// Distributed under the MIT License (http://opensource.org/licenses/MIT) | ||
|
||
#pragma once | ||
|
||
#ifndef SPDLOG_HEADER_ONLY | ||
#include <spdlog/async_logger.h> | ||
#endif | ||
|
||
#include <spdlog/sinks/sink.h> | ||
#include <spdlog/details/thread_pool.h> | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
SPDLOG_INLINE spdlog::async_logger::async_logger( | ||
std::string logger_name, sinks_init_list sinks_list, std::weak_ptr<details::thread_pool> tp, async_overflow_policy overflow_policy) | ||
: async_logger(std::move(logger_name), sinks_list.begin(), sinks_list.end(), std::move(tp), overflow_policy) | ||
{} | ||
|
||
SPDLOG_INLINE spdlog::async_logger::async_logger( | ||
std::string logger_name, sink_ptr single_sink, std::weak_ptr<details::thread_pool> tp, async_overflow_policy overflow_policy) | ||
: async_logger(std::move(logger_name), {std::move(single_sink)}, std::move(tp), overflow_policy) | ||
{} | ||
|
||
// send the log message to the thread pool | ||
SPDLOG_INLINE void spdlog::async_logger::sink_it_(const details::log_msg &msg) | ||
{ | ||
if (auto pool_ptr = thread_pool_.lock()) | ||
{ | ||
pool_ptr->post_log(shared_from_this(), msg, overflow_policy_); | ||
} | ||
else | ||
{ | ||
throw_spdlog_ex("async log: thread pool doesn't exist anymore"); | ||
} | ||
} | ||
|
||
// send flush request to the thread pool | ||
SPDLOG_INLINE void spdlog::async_logger::flush_() | ||
{ | ||
if (auto pool_ptr = thread_pool_.lock()) | ||
{ | ||
pool_ptr->post_flush(shared_from_this(), overflow_policy_); | ||
} | ||
else | ||
{ | ||
throw_spdlog_ex("async flush: thread pool doesn't exist anymore"); | ||
} | ||
} | ||
|
||
// | ||
// backend functions - called from the thread pool to do the actual job | ||
// | ||
SPDLOG_INLINE void spdlog::async_logger::backend_sink_it_(const details::log_msg &msg) | ||
{ | ||
for (auto &sink : sinks_) | ||
{ | ||
if (sink->should_log(msg.level)) | ||
{ | ||
SPDLOG_TRY | ||
{ | ||
sink->log(msg); | ||
} | ||
SPDLOG_LOGGER_CATCH() | ||
} | ||
} | ||
|
||
if (should_flush_(msg)) | ||
{ | ||
backend_flush_(); | ||
} | ||
} | ||
|
||
SPDLOG_INLINE void spdlog::async_logger::backend_flush_() | ||
{ | ||
for (auto &sink : sinks_) | ||
{ | ||
SPDLOG_TRY | ||
{ | ||
sink->flush(); | ||
} | ||
SPDLOG_LOGGER_CATCH() | ||
} | ||
} | ||
|
||
SPDLOG_INLINE std::shared_ptr<spdlog::logger> spdlog::async_logger::clone(std::string new_name) | ||
{ | ||
auto cloned = std::make_shared<spdlog::async_logger>(*this); | ||
cloned->name_ = std::move(new_name); | ||
return cloned; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. | ||
// Distributed under the MIT License (http://opensource.org/licenses/MIT) | ||
|
||
#pragma once | ||
#include <spdlog/cfg/helpers.h> | ||
#include <spdlog/details/registry.h> | ||
|
||
// | ||
// Init log levels using each argv entry that starts with "SPDLOG_LEVEL=" | ||
// | ||
// set all loggers to debug level: | ||
// example.exe "SPDLOG_LEVEL=debug" | ||
|
||
// set logger1 to trace level | ||
// example.exe "SPDLOG_LEVEL=logger1=trace" | ||
|
||
// turn off all logging except for logger1 and logger2: | ||
// example.exe "SPDLOG_LEVEL=off,logger1=debug,logger2=info" | ||
|
||
namespace spdlog { | ||
namespace cfg { | ||
|
||
// search for SPDLOG_LEVEL= in the args and use it to init the levels | ||
void load_argv_levels(int argc, const char **argv) | ||
{ | ||
const std::string spdlog_level_prefix = "SPDLOG_LEVEL="; | ||
for (int i = 1; i < argc; i++) | ||
{ | ||
std::string arg = argv[i]; | ||
if (arg.find(spdlog_level_prefix) == 0) | ||
{ | ||
auto levels_string = arg.substr(spdlog_level_prefix.size()); | ||
auto levels = helpers::extract_levels(levels_string); | ||
details::registry::instance().update_levels(std::move(levels)); | ||
} | ||
} | ||
} | ||
|
||
void load_argv_levels(int argc, char **argv) | ||
{ | ||
load_argv_levels(argc, const_cast<const char **>(argv)); | ||
} | ||
|
||
} // namespace cfg | ||
} // namespace spdlog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors. | ||
// Distributed under the MIT License (http://opensource.org/licenses/MIT) | ||
|
||
#pragma once | ||
#include <spdlog/cfg/helpers.h> | ||
#include <spdlog/details/registry.h> | ||
#include <spdlog/details/os.h> | ||
|
||
// | ||
// Init levels and patterns from env variables SPDLOG_LEVEL | ||
// Inspired from Rust's "env_logger" crate (https://crates.io/crates/env_logger). | ||
// Note - fallback to "info" level on unrecognized levels | ||
// | ||
// Examples: | ||
// | ||
// set global level to debug: | ||
// export SPDLOG_LEVEL=debug | ||
// | ||
// turn off all logging except for logger1: | ||
// export SPDLOG_LEVEL="off,logger1=debug" | ||
// | ||
|
||
// turn off all logging except for logger1 and logger2: | ||
// export SPDLOG_LEVEL="off,logger1=debug,logger2=info" | ||
|
||
namespace spdlog { | ||
namespace cfg { | ||
void load_env_levels() | ||
{ | ||
auto env_val = details::os::getenv("SPDLOG_LEVEL"); | ||
auto levels = helpers::extract_levels(env_val); | ||
details::registry::instance().update_levels(std::move(levels)); | ||
} | ||
|
||
} // namespace cfg | ||
} // namespace spdlog |
Oops, something went wrong.