STTNet
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Static Public Member Functions | Static Public Attributes | List of all members
stt::system::ServerSetting Class Reference

Class for initializing the service system. More...

#include <sttnet_English.h>

Static Public Member Functions

static void setExceptionHandling ()
 Set system signals. More...
 
static void setLogFile (file::LogFile *logfile=nullptr, const std::string &language="")
 Set the log file object for the logging system If the passed log file object is uninitialized (empty), the system automatically generates a server_log folder in the program directory and creates a log file based on the current time to record the network communication of the service program. If the passed log file object is initialized, the log file under the current object is enabled. More...
 
static void init (file::LogFile *logfile=nullptr, const std::string &language="")
 Execute the setExceptionHandling and setfile::LogFile functions to complete the initialization of signals and the logging system. More...
 

Static Public Attributes

static file::LogFilelogfile
 Pointer to the log file object for reading and writing logs in the system. More...
 
static std::string language
 Language selection for the system's logging system, default is English. More...
 

Detailed Description

Class for initializing the service system.

Member Function Documentation

static void stt::system::ServerSetting::init ( file::LogFile logfile = nullptr,
const std::string &  language = "" 
)
static

Execute the setExceptionHandling and setfile::LogFile functions to complete the initialization of signals and the logging system.

Parameters
logfilePointer to the log file object. If the object is uninitialized, the system automatically generates a server_log folder and creates a log file based on the current time. (Default is nullptr, no log file is set)
languageLanguage of the log file. "Chinese" for Chinese, otherwise English. (Default is empty, set to English)
static void stt::system::ServerSetting::setExceptionHandling ( )
static

Set system signals.

  • Blocks signals 1-14 and 14-64
  • Sends signal 15 when receiving SIGSEGV
  • Sends signal 15 when an uncaught exception occurs
  • Sends signal 15 when receiving SIGABRT
  • The exit method for signal 15 is customized
static void stt::system::ServerSetting::setLogFile ( file::LogFile logfile = nullptr,
const std::string &  language = "" 
)
static

Set the log file object for the logging system If the passed log file object is uninitialized (empty), the system automatically generates a server_log folder in the program directory and creates a log file based on the current time to record the network communication of the service program. If the passed log file object is initialized, the log file under the current object is enabled.

Parameters
logfilePointer to the log file object. If the object is uninitialized, the system automatically generates a server_log folder and creates a log file based on the current time. (Default is nullptr, no log file is set)
languageLanguage of the log file. "Chinese" for Chinese, otherwise English. (Default is empty, set to English)

Member Data Documentation

std::string stt::system::ServerSetting::language
static

Language selection for the system's logging system, default is English.

file::LogFile* stt::system::ServerSetting::logfile
static

Pointer to the log file object for reading and writing logs in the system.


The documentation for this class was generated from the following file: