This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Полезные советы
Программирование на C#
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров узла
Setting Up Materials
Setting Up Properties
Освещение
Landscape Tool
Sandworm (Experimental)
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
UnigineScript
C++
C#
Унифицированный язык шейдеров UUSL
File Formats
Rebuilding the Engine Tools
GUI
Двойная точность координат
API
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
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии 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: console_onscreen 1

There are two custom color schemes highlighting log syntax for Notepad++ included in the SDK:

  • <SDK>/utils/log_styles/notepad_light.xml
  • <SDK>/utils/log_styles/notepad_dark.xml

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 * format, ... ) #

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

Arguments

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

void errorLine ( const char * format, ... ) #

Prints an error message followed by the line terminator to the console and the log file.

Arguments

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

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

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

Arguments

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

void fatalLine ( const char * format, ... ) #

Prints a fatal error message followed by the line terminator to the log file and quits the engine.

Arguments

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

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

Prints a message to the console and the log file.

Arguments

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

void messageLine ( const char * format, ... ) #

Prints a message followed by the line terminator to the console and the log file.

Arguments

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

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

Prints a warning to the console and the log file.

Arguments

  • const char * format - Warning to print.
  • ... - Arguments, multiple allowed.

void warningLine ( const char * format, ... ) #

Prints a warning followed by the line terminator to the console and the log file.

Arguments

  • const char * format - Warning to print.
  • ... - Arguments, multiple allowed.
Last update: 24.11.2020
Build: ()