Git Product home page Git Product logo

qlog's Introduction

QLOG

Quick Log for C++`

Building

Quick Log is distributed only as a header. There is nothing to compile in this repository other than tests which also illustrate how to use QLOG.

Dependencies

Instructions

I highly recommend building outside of the source tree so that build products do not pollute the repository. The simplest way to accomplish this is to create a sub-directory named "build" as follows:

$ mkdir build
$ cd build
$ cmake ..
$ make

Examples

Send All Log Output to Standard Error

qlog::logger my_log;

Open or Append to a Log File

std::ofstream log_file("error.log", std::ios::app);
qlog::logger my_log(log_file);

Open or Append Only Errors and Warnings to a Log File

std::ofstream log_file("error.log", std::ios::app);
qlog::logger my_log(log_file, qlog::warning);

Emit an Error Message.

my_log(qlog::error) << "This is an error message";

Emit a Debug Message.

my_log(qlog::debug) << "This is a debug message.";
// Note that if the verbosity level is qlog::warning, as shown above, this
// message will not be sent to the log.

To Do

  1. Move all configuration to a separate class.
  2. Add log aging by size (e.g. 1 MB) or time span (e.g. daily, weekly, or monthly)
  3. When aging the log, maintain a maximum number of "old" log files.
  4. Add a dependency on the ASF library for formatting.

Contributing

  1. Fork it
  2. Create a feature branch (git checkout -b new-feature)
  3. Commit changes (git commit -am "Added new feature xyz")
  4. Push the branch (git push origin new-feature)
  5. Create a new pull request.

Maintainers

License

Quick Log copyright 2014 Paul Howes and is licensed under the Apache License.

qlog's People

Contributors

pahowes avatar

Watchers

 avatar James Cloos 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.