Class for initializing the service system.
More...
#include <sttnet_English.h>
|
| 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 file::LogFile * | logfile |
| | 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...
|
| |
Class for initializing the service system.
- Suitable for initializing service programs that need to run stably
- If the passed log file object is uninitialized (empty), the system automatically creates a server_log folder in the program directory and generates a log file based on the current time; if it is an initialized object, the log file under the current object is enabled.
- Once the logging system is set up, it generates log files to record the operational dynamics of the service network program
- The effective working time of the logging system is related to the lifecycle of the passed log file object
| 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
-
| logfile | Pointer 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) |
| language | Language 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
-
| logfile | Pointer 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) |
| language | Language of the log file. "Chinese" for Chinese, otherwise English. (Default is empty, set to English) |
| std::string stt::system::ServerSetting::language |
|
static |
Language selection for the system's logging system, default is English.
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: