File: mg_cry.md

package info (click to toggle)
civetweb 1.13%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,296 kB
  • sloc: ansic: 30,345; cpp: 1,148; sh: 388; javascript: 204; python: 143; makefile: 92; perl: 6; php: 1
file content (23 lines) | stat: -rw-r--r-- 880 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Civetweb API Reference

### `mg_cry( conn, fmt, ... );`

### Parameters

| Parameter | Type | Description |
| :--- | :--- | :--- |
|**`conn`**|`const struct mg_connection *`|The connection on which a problem occurred|
|**`fmt`**|`const char *`|Format string without a line return|
|**`...`**|*various*|Parameters depending on the format string|

### Return Value

*none*

### Description

The function `mg_cry()` is called when something happens on a connection. The function takes a format string similar to the `printf()` series of functions with parameters and creates a text string which can then be used for logging. The `mg_cry()` function prints the output to the opened error log stream. Log messages can be processed with the `log_message()` callback function specified in the `struct mg_callbacks` structure.

### See Also

* [`struct mg_callbacks;`](mg_callbacks.md)