WriteData
Writes data to the log file. It is used for logs in JS code.
note
For JS, this method is not used.
Syntax
- Python
- C++
- COM
- Java
- .Net
def WriteData(self, path: str, value: str, append: bool)
void WriteData(const wchar_t* sPath, const wchar_t* sValue, const bool& bAppend);
HRESULT WriteData([in] BSTR path, [in] BSTR value, [in] VARIANT_BOOL append);
void writeData(String path, String value, boolean append);
void WriteData(String^ sPath, String^ sValue, bool bAppend);
Parameters
- Python
- C++
- COM
- Java
- .Net
| Name | Type | Description |
|---|---|---|
| path | str | The path to the file where all the logs will be written. |
| value | str | The data which will be written to the log file. |
| append | bool | Specifies if the new data will be appended to the already existing log file or a new file will be created. |
| Name | Type | Description |
|---|---|---|
| sPath | const wchar_t* | The path to the file where all the logs will be written. |
| sValue | const wchar_t* | The data which will be written to the log file. |
| bAppend | const bool& | Specifies if the new data will be appended to the already existing log file or a new file will be created. |
| Name | Type | Description |
|---|---|---|
| path | BSTR | The path to the file where all the logs will be written. |
| value | BSTR | The data which will be written to the log file. |
| append | VARIANT_BOOL | Specifies if the new data will be appended to the already existing log file or a new file will be created. |
| Name | Type | Description |
|---|---|---|
| path | String | The path to the file where all the logs will be written. |
| value | String | The data which will be written to the log file. |
| append | boolean | Specifies if the new data will be appended to the already existing log file or a new file will be created. |
| Name | Type | Description |
|---|---|---|
| sPath | String^ | The path to the file where all the logs will be written. |
| sValue | String^ | The data which will be written to the log file. |
| bAppend | bool | Specifies if the new data will be appended to the already existing log file or a new file will be created. |
Example
- Python
- C++
- COM
- Java
- .Net
import docbuilder
builder = docbuilder.CDocBuilder()
builder.WriteData("result.log", "Alert!", False)
std::wstring sWorkDirectory = NSUtils::GetBuilderDirectory();
CDocBuilder::Initialize(sWorkDirectory.c_str());
CDocBuilder oBuilder;
oBuilder.WriteData(L"result.log", L"Alert!", false);
CDocBuilder::Dispose();
CoInitialize(NULL);
IONLYOFFICEDocBuilder* oBuilder = NULL;
oBuilder->WriteData("result.log", "Alert!", VARIANT_FALSE);
oBuilder->Dispose();
CDocBuilder.initialize("");
CDocBuilder builder = new CDocBuilder();
builder.writeData("result.log", "Alert!", false);
CDocBuilder.dispose();
string workDirectory = "C:/Program Files/ONLYOFFICE/documentBuilder";
CDocBuilder.Initialize(workDirectory);
CDocBuilder oBuilder = new CDocBuilder();
oBuilder.WriteData("result.log", "Alert!", false);
CDocBuilder.Destroy();