Implementation of logger functions.
More...
#include "tui.h"
#include "ansi.h"
#include "logs.h"
#include "ansi_const.h"
Go to the source code of this file.
|
LogsConfiguration | prepareLogs () |
| Generates the logger configuration for the current session. Tries to generate the log file.
|
void | printGameConfiguration (GameConfiguration configuration, LogsConfiguration logsConfiguration, bool newLine) |
| Prints user-friendly game configuration settings.
|
void | printPlayers (Game game, bool newLine) |
| Prints user-friendly the players' infos.
|
void | printPlayer (Player player, LogsConfiguration logsConfiguration, bool newLine) |
| Prints user-friendly player's info.
|
void | printCard (Card card, LogsConfiguration logsConfiguration, bool newLine) |
| Prints user-friendly the card rank and suit.
|
void | printDeck (Card *deck, LogsConfiguration logsConfiguration, bool newLine) |
| Prints user-friendly the cards deck.
|
void | printPageData (PageData pages[], LogsConfiguration logsConfiguration, int totalPages, bool newLine) |
| Prints user-friendly the pages' infos.
|
Implementation of logger functions.
Definition in file logs.c.
◆ prepareLogs()
Generates the logger configuration for the current session. Tries to generate the log file.
- Returns
- The logger configuration to use.
Definition at line 26 of file logs.c.
◆ printCard()
Prints user-friendly the card rank and suit.
- Parameters
-
card | The card that has to be printed. |
logsConfiguration | The logs configuration. |
newLine | Flag for determining if the function has to go to a new line before exiting. Differently from the behaviour of the other functions, this value is not ignored if the logger is not using the console. |
Definition at line 112 of file logs.c.
◆ printDeck()
Prints user-friendly the cards deck.
- Parameters
-
deck | The deck that has to be printed. |
logsConfiguration | The logs configuration. |
newLine | Flag for determining if the function has to go to a new line before exiting. If the logger is not using the console, this value is ignored and a new line is always generated. |
Definition at line 172 of file logs.c.
◆ printGameConfiguration()
Prints user-friendly game configuration settings.
- Parameters
-
gameConfiguration | The game configuration that has to be printed. |
logsConfiguration | The logs configuration. |
newLine | Flag for determining if the function has to go to a new line before exiting. If the logger is not using the console, this value is ignored and a new line is always generated. |
Definition at line 53 of file logs.c.
◆ printPageData()
Prints user-friendly the pages' infos.
- Parameters
-
pages | An array of structures containing informations about each page. |
logsConfiguration | The logs configuration. |
totalPages | The amount of page structures in the array. |
newLine | Flag for determining if the function has to go to a new line before exiting. If the logger is not using the console, this value is ignored and a new line is always generated. |
Definition at line 177 of file logs.c.
◆ printPlayer()
Prints user-friendly player's info.
- Parameters
-
player | The player whose infos have to be printed. |
logsConfiguration | The logs configuration. |
newLine | Flag for determining if the function has to go to a new line before exiting. If the logger is not using the console, this value is ignored and a new line is always generated. |
Definition at line 81 of file logs.c.
◆ printPlayers()
void printPlayers |
( |
Game | game, |
|
|
bool | newLine ) |
Prints user-friendly the players' infos.
- Parameters
-
game | The game which cointains the players. |
newLine | Flag for determining if the function has to go to a new line before exiting. If the logger is not using the console, this value is ignored and a new line is always generated. |
Definition at line 76 of file logs.c.