Skip to content

Commit

Permalink
Log to stdout aswell
Browse files Browse the repository at this point in the history
  • Loading branch information
lolleko committed Jul 11, 2020
1 parent e2400df commit 87bfccf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion include/core/vs_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ struct VSLog
std::make_shared<spdlog::sinks::basic_file_sink_mt>("logs/voxelscape.log", true);

auto ostream_sink = std::make_shared<spdlog::sinks::ostream_sink_mt>(logStream);
const std::vector<spdlog::sink_ptr> sinks = {ostream_sink, file_sink};

auto console_sink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();

const std::vector<spdlog::sink_ptr> sinks = {ostream_sink, file_sink, console_sink};

// const auto longestCategoryName = std::max_element(
// categoryNames.begin(), categoryNames.end(), [](const auto& a, const auto& b) {
Expand Down
7 changes: 6 additions & 1 deletion include/game/building_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,12 @@ namespace BuildingParser
nlohmann::json componentJson;
componentsFile >> componentJson;

VSLog::Log(VSLog::Category::Core, VSLog::Level::info, "{0}", componentJson.dump(4));
VSLog::Log(
VSLog::Category::Game,
VSLog::Level::info,
"Loaded Building \"{0}\":\n{1}",
buildingDirectory.string(),
componentJson.dump(4));

if (!componentJson.contains("uuid"))
{
Expand Down
3 changes: 2 additions & 1 deletion include/world/vs_chunk_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ class VSChunkManager : public IVSDrawable

std::map<VSChunk*, std::shared_ptr<VSVisibilityChunkUpdate>> activeVisibilityBuildTasks;

const static inline auto maxShadowUpdateThreads = std::thread::hardware_concurrency();
const static inline auto maxShadowUpdateThreads =
std::thread::hardware_concurrency() == 0 ? 4 : std::thread::hardware_concurrency() + 1;

const static inline std::vector<float> blockEmission = {
/*Air=0*/ 0.F,
Expand Down
Binary file modified resources/models/cube.blend
Binary file not shown.
Binary file modified resources/models/cube.blend1
Binary file not shown.

0 comments on commit 87bfccf

Please sign in to comment.