GithubHelp home page GithubHelp logo

nova's Introduction

Nova Multi-threaded Logger

Nova is a header-only, multi-threaded C++ logger. It will take in messages and log them to the console. The concept of Nova is to allow messages to be quickly logged to the console, without causing slow down, due to the consoles slow speed.

Usage

To use Nova, simply call a begin and end function activate the logger. Then call the log functions to begin logging messages. Nova also requires a macro to be set in order to be used. This allows you to only allow Nova to run on debug builds. The log functions used will check this macro so you don't have to worry about checking it. Below is an example programming showing what to do and what not to do.

#define NOVA_ENABLE //Allows the logger to be included
#include <Nova/Nova.h>

int main(int, char**)
{
	//If this is not called, any messages logged will wait in a buffer for the logger to be activated
	Nova::Begin();

	Nova::Log("Hello from Nova =D"); //Prints "[INFO] Hello from Nova =D"
	Nova::LogWarning("I am warning the user of potentially incorrect behaviour");
	Nova::LogError("Oh no. Something went wrong");
	Nova::LogTodo("I need to implement something here");
	Nova::LogAssert("I can write my own assert function to call this so I have Nova handled assert messages");
	Nova::LogRaw("Anything I write here will not have a prefix such as [INFO] or [ERROR]");

	Nova::Logger::Log("This is bad!. If NOVA_ENABLED is not set, this will be an error, whereas the lines above will not");

	//Any messages logged after this will not print, until Begin is called again
	Nova::End();
}

You can also write custom functions to print to Nova

struct Vec2
{
	float x;
	float y;
}

void LogVec2(const Vec2& vec2)
{
	std::string message = "X: " + std::to_string(vec2.x);
	message += ", Y: " + std::to_string(vec2.y);
	Nova::Log(message);
}

nova's People

Contributors

syxzyt avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.