    

 ## On this page

  

 

 # Miscellaneous

 Last update: 16.07.2025 

## <a name="nested-classes"></a>Classes

class [RealList](class_real_list.xhtml) a convenience class for Lua (std::list&lt;number&gt;) [More...](class_real_list.xhtml#details)  
 ## <a name="func-members"></a>Functions

string [currentScriptPath](group__misc.xhtml#gae50275197090093dde0b291bba13ed6d) () Determines the current directory of the the currently running script file. [More...](#gae50275197090093dde0b291bba13ed6d)  
  [loadMacros](group__misc.xhtml#gac2e3aa62e39e5a82dd1f3b2bddc1fe41) (macro::MacroManager macroManager) Load macros stored at the [MacroManager](class_macro_manager.xhtml "stores a set of macro definitions MacroManager is a common::Sender. Listeners can register themselves..."). Loaded macros are callable functions in SoS script context. Loaded macros are stored in the *sos\_macros* Lua table. Example call: [More...](#gac2e3aa62e39e5a82dd1f3b2bddc1fe41)  
  [loadMacros](group__misc.xhtml#gacc1f94f24e8a810977c3d4d8c7c0a0b9) () Load macros stored at the [MacroManager](class_macro_manager.xhtml "stores a set of macro definitions MacroManager is a common::Sender. Listeners can register themselves...") of the current sos.database(). Loaded macros are callable functions in SoS script context. Loaded macros are stored in the *sos\_macros* Lua table. Example call: [More...](#gacc1f94f24e8a810977c3d4d8c7c0a0b9)  
  [log](group__misc.xhtml#gac54ef505f435c0792a201496df7ac71a) (string message) Issues an info log message. [More...](#gac54ef505f435c0792a201496df7ac71a)  
  [log](group__misc.xhtml#gaf74ccfa3835ac7064c7b8548b805e848) (number level, string message) Issues a log message to the SoS logger. [More...](#gaf74ccfa3835ac7064c7b8548b805e848)  
  [setLogLevel](group__misc.xhtml#gad03ab6943f70cf074ab3c4968f391dee) (number level=3, int log\_id=-1) sets the verbose level of the logger [More...](#gad03ab6943f70cf074ab3c4968f391dee)  
  [setMaxNumThreads](group__misc.xhtml#ga1446974842fc22f6562c679a6b168391) (number numthreads) Sets the maximum number of threads used in OpenMP. [More...](#ga1446974842fc22f6562c679a6b168391)  
 bool [useCommandLogFile](group__misc.xhtml#gaee56115d53407a868281c97b9c8a3daa) (bool usage=true) Controls the usage of SoS's command log file. [More...](#gaee56115d53407a868281c97b9c8a3daa)  
 <a id="details" name="details"></a>## Detailed Description

## Function Documentation

<a id="gae50275197090093dde0b291bba13ed6d"></a>## [◆ ](#gae50275197090093dde0b291bba13ed6d)currentScriptPath()

 string currentScriptPath  ( ) 

Determines the current directory of the the currently running script file.

The method uses the global interpreter() function to access the Lua state.

ReturnsThe current directory of the script being processed at the moment. Exceptions Anexception if the current script is not a file 



<a id="gac2e3aa62e39e5a82dd1f3b2bddc1fe41"></a>## [◆ ](#gac2e3aa62e39e5a82dd1f3b2bddc1fe41)loadMacros() \[1/2\]

 loadMacros  ( macro::MacroManager  *macroManager*) 

Load macros stored at the [MacroManager](class_macro_manager.xhtml "stores a set of macro definitions MacroManager is a common::Sender. Listeners can register themselves..."). Loaded macros are callable functions in SoS script context. Loaded macros are stored in the *sos\_macros* Lua table. Example call:

sos\_macros.getNodeMin(sos.database(), "1", 'TEMP', 'min\[TEMP\]')

Parameters macroManagerA reference to the [MacroManager](class_macro_manager.xhtml "stores a set of macro definitions MacroManager is a common::Sender. Listeners can register themselves..."). All the macroManager's macros are loaded. 



<a id="gacc1f94f24e8a810977c3d4d8c7c0a0b9"></a>## [◆ ](#gacc1f94f24e8a810977c3d4d8c7c0a0b9)loadMacros() \[2/2\]

 loadMacros  ( ) 

Load macros stored at the [MacroManager](class_macro_manager.xhtml "stores a set of macro definitions MacroManager is a common::Sender. Listeners can register themselves...") of the current sos.database(). Loaded macros are callable functions in SoS script context. Loaded macros are stored in the *sos\_macros* Lua table. Example call:

sos\_macros.getNodeMin(sos.database(), "1", 'TEMP', 'min\[TEMP\]')





<a id="gac54ef505f435c0792a201496df7ac71a"></a>## [◆ ](#gac54ef505f435c0792a201496df7ac71a)log() \[1/2\]

 log  ( string  *message*) 

Issues an info log message.

Parameters messageThe info log message 



<a id="gaf74ccfa3835ac7064c7b8548b805e848"></a>## [◆ ](#gaf74ccfa3835ac7064c7b8548b805e848)log() \[2/2\]

 log  ( number  *level*,    string  *message*   ) 

Issues a log message to the SoS logger.

Parameters levelDefines the log level. Accepts values between \[1-5\] as well as their corresponding enum values- 1 / logger.ERROR .. error
- 2 / logger.WARNING .. warning
- 3 / logger.INFO .. info
- 4 / logger.DEBUG .. debug
- 5 / logger.TRACE .. trace

messageThe log message itself Exceptions Incase of unknown log level 



<a id="gad03ab6943f70cf074ab3c4968f391dee"></a>## [◆ ](#gad03ab6943f70cf074ab3c4968f391dee)setLogLevel()

 setLogLevel  ( number  *level* = `3`,    int  *log\_id* = `-1`   ) 

sets the verbose level of the logger

Parameters leveldefines the new log level log\_idGives the Id of the logger to set the level for. If omitted all loggers maintained get the same level The following levels exist:- 0 .. no output
- 1 .. only errors
- 2 .. like 1 + warnings
- 3 .. like 2 + info (default)
- 4 .. like 3 + debug info
- 5 .. like 4 + trace info





<a id="ga1446974842fc22f6562c679a6b168391"></a>## [◆ ](#ga1446974842fc22f6562c679a6b168391)setMaxNumThreads()

 setMaxNumThreads  ( number  *numthreads*) 

Sets the maximum number of threads used in OpenMP.

Parameters numthreadsthe number of threads NoteDoes not have any action if OpenMP is disabled. 



<a id="gaee56115d53407a868281c97b9c8a3daa"></a>## [◆ ](#gaee56115d53407a868281c97b9c8a3daa)useCommandLogFile()

 bool useCommandLogFile  ( bool  *usage* = `true`) 

Controls the usage of SoS's command log file.

Parameters usageSet to true (default) if a command log file is desired. False otherwise ReturnsThe previous state NoteThe command log file will be updated each time the lua interpreter is about to start the execution of a new line of code. This means the physical command log file will be rewritten for EACH LINE! In consequence, at least if there is any change that your loop might get huge for some input, you're strongly advised to switch command log file support off immediately before entering the loop and to reanable it afterwards