This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
应用程序接口
Containers
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::Log Class

Header: #include <UnigineLog.h>

This class represents an interface for printing various types of messages to the console and to the log file. It can be useful to monitor overall progress of application execution and report errors which can be helpful in the process of debugging.

Notice
To enable displaying system messages in the Console use the following command: show_messages 1

Example#

The following code demonstrates how to print various types of messages.

Source code (C++)
using namespace Unigine;

// auxiliary variables for messages
char *file_name = "file.txt";
int ID = 10;
	
// reporting an error message
Log::error("Loading mesh: can't open \"%s\" file\n", file_name);

// reporting a message
Log::message("-> Added %d UI elements.\n", 10);
	
// reporting a warning message
Log::warning("ID of the \"%s\" file: %d.\n", file_name, ID);
	
// reporting a fatal error message to the log file and closing the application
Log::fatal("FATAL ERROR reading \"%s\" file!\n", file_name);

Log Class

Members


void error ( const char * str, ... ) #

Prints an error message to the console and the log file.

Arguments

  • const char * str - Error message to print.
  • ... - Arguments, multiple allowed.

void fatal ( const char * str, ... ) #

Prints a fatal error message to the log file and quits the engine.

Arguments

  • const char * str - Fatal error message to print.
  • ... - Arguments, multiple allowed.

void message ( const char * str, ... ) #

Prints a message to the console and the log file.

Arguments

  • const char * str - Message to print.
  • ... - Arguments, multiple allowed.

void warning ( const char * str, ... ) #

Prints a warning to the console and the log file.

Arguments

  • const char * str - Warning to print.
  • ... - Arguments, multiple allowed.
Last update: 2020-05-19
Build: ()