mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-16 20:32:13 +01:00
improving logging (#5)
* small refactoring of error messages * (very) small refactoring of structs instantiation * improving logging with debug messages * using INFO level as default + changing previous debug message to info message
This commit is contained in:
@@ -28,6 +28,15 @@ func load(configurationFilePath string) {
|
||||
config.ParseFile(path)
|
||||
}
|
||||
|
||||
func TestCommandTimeoutError(t *testing.T) {
|
||||
err := &commandTimeoutError{"echo hello", 30}
|
||||
expected := fmt.Sprintf(commandTimeoutErrorMessage, err.command, err.timeout)
|
||||
|
||||
if err.Error() != expected {
|
||||
t.Errorf("Error returned a wrong message: got '%s' want '%s'", err.Error(), expected)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRun(t *testing.T) {
|
||||
var cmd string
|
||||
|
||||
@@ -118,14 +127,3 @@ func TestMerge(t *testing.T) {
|
||||
|
||||
os.RemoveAll(workingDir)
|
||||
}
|
||||
|
||||
func TestCommandTimeoutError(t *testing.T) {
|
||||
err := &commandTimeoutError{
|
||||
command: "echo hello",
|
||||
timeout: 30,
|
||||
}
|
||||
expected := fmt.Sprintf("The command '%s' has reached the %d second(s) timeout", err.command, err.timeout)
|
||||
if err.Error() != expected {
|
||||
t.Errorf("Error returned a wrong message: got '%s' want '%s'", err.Error(), expected)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user