2
0
mirror of https://github.com/meganz/MEGAcmd synced 2025-08-22 09:57:09 +00:00
MEGAcmd/contrib/docs/DEBUG.md

95 lines
2.4 KiB
Markdown
Raw Normal View History

# Debugging MEGAcmd
There are two different kinds of logging messages:
- MEGAcmd based: those messages reported by MEGAcmd itself.
These messages will show information regarding the processing of user commands.
- SDK based: those messages reported by the sdk and dependent libraries.
2024-06-19 14:09:51 +02:00
These messages will show information regarding requests, transfers, network, etc.
They will be labeled with `SDK:`.
MEGAcmdServer logs messages depending on the level of log adjusted to those
two categories. You can adjust the level of logging for those kinds with `log` command.
Log levels range from FATAL (the lowest) to VERBOSE (the highest).
## How to access the logs
2024-06-19 14:09:51 +02:00
Accessing the logs depends on the platform you are in.
### MacOS
2024-06-19 14:09:51 +02:00
By default, whenever MEGAcmdServer is executed, it will log the output into
`$HOME/.megaCmd/megacmdserver.log`.
If you want to launch it manually execute in a terminal:
```
export PATH=/Applications/MEGAcmd.app/Contents/MacOS:$PATH
./mega-cmd
```
### Linux
2024-06-19 14:09:51 +02:00
By default, whenever MEGAcmdServer is executed, it will log the output into
$HOME/.megaCmd/megacmdserver.log.
If you want to launch it manually execute in a terminal:
```
mega-cmd-server
```
### Windows
2024-06-19 14:09:51 +02:00
MEGAcmdServer is executed in the background without saving the log into a file. If you want to
see the output you would need to execute the server (MEGAcmdServer.exe) manually.
## Verbosity on startup
You can start the server with higher level of verbosity in order to have log levels increased at startup.
In Windows & Linux you will need to pass `--debug-full` as an argument to the executable (e.g: `MEGAcmdServer.exe --debug-full`).
In MacOS, you can use `MEGACMD_LOGLEVEL` environment variable like this: `MEGACMD_LOGLEVEL=FULLDEBUG ./mega-cmd`.
If you want other startup level of loggin, you can use:
* `--debug`
* `MEGACMD_LOGLEVEL=DEBUG`
This will set:
MEGAcmd log level = DEBUG
SDK log level = DEFAULT
* `--debug-full`
* `MEGACMD_LOGLEVEL=DEBUG`
This will set:
MEGAcmd log level = DEBUG
SDK log level = DEBUG
* `--verbose`
* `MEGACMD_LOGLEVEL=VERBOSE`
This will set:
MEGAcmd log level = VERBOSE
SDK log level = DEFAULT
* `--verbose-full`
* `MEGACMD_LOGLEVEL=FULLVERBOSE`
This will set:
MEGAcmd log level = VERBOSE
SDK log level = VERBOSE
## Controlling verbosity of a single command
2024-06-19 14:09:51 +02:00
You can pass `-v` (`-vv`, `-vvv`, and so on for a more verbose output)
to an specific command and it will use higher level of verbosity of MEGAcmd based messages.