Skip to content

Log.cc usage

Gordon Zhang edited this page Jul 14, 2024 · 7 revisions

Welcome to the log.cc wiki!

Usage

Note

The basic functions are introduced in README.md. Here I will tell you more functions defined in Log.cc.

The following examples use l as the default logger name.

Setting the log level

You can use the set_log_level function.

Example

l.set_log_level(WARNING);

Now only log message which are more important than (or as important as) Warning will me shown.

Disable

You can use the disable function. Example: l.disable(); To enable the logger again, use the enable function.

Disable the terminal output

Tip

Sometimes, it's necessary to disable the terminal log output (especially when developing a GUI app, users don't want to see a terminal with plenty of messages).

l.disable_terminal_output();

To enable terminal output again, use the enable_terminal_output function.

More info

You can view log.cc and log.h in the src/ dir.

Clone this wiki locally