Skip to content

Commit a256b11

Browse files
committed
Formatting logs
1 parent 0452c40 commit a256b11

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/main/scala/de/upb/cs/swt/delphi/instanceregistry/RequestHandler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
556556
} else if (!isInstanceDockerContainer(id)) {
557557
OperationResult.NoDockerContainer
558558
} else {
559-
log.info(s"Handling /start for instance with id $id...")
559+
log.debug(s"Handling /start for instance with id $id...")
560560
val instance = instanceDao.getInstance(id).get
561561
if (instance.instanceState == InstanceState.Stopped) {
562562
implicit val timeout: Timeout = configuration.dockerOperationTimeout
@@ -589,7 +589,7 @@ class RequestHandler(configuration: Configuration, instanceDao: InstanceDAO, con
589589
} else if (!isInstanceDockerContainer(id)) {
590590
OperationResult.NoDockerContainer
591591
} else {
592-
log.info(s"Handling /delete for instance with id $id...")
592+
log.debug(s"Handling /delete for instance with id $id...")
593593
val instance = instanceDao.getInstance(id).get
594594

595595
//It is not safe to delete instances when other running instances depend on it!

src/main/scala/de/upb/cs/swt/delphi/instanceregistry/connection/Server.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,18 @@ class Server(handler: RequestHandler) extends HttpApp
157157
id.toString
158158
}
159159
case Failure(ex) =>
160-
log.error(ex, "Failed to handle registration of instance.")
160+
log.warning(s"Failed to handle registration of instance. ${ex.getMessage}")
161161
complete(HttpResponse(StatusCodes.InternalServerError, entity = "An internal server error occurred."))
162162
}
163163
} catch {
164164
case dx: DeserializationException =>
165-
log.error(dx, "Deserialization exception")
166-
complete(HttpResponse(StatusCodes.BadRequest, entity = s"Could not deserialize parameter instance with message ${dx.getMessage}."))
165+
log.warning(s"Deserialization exception: ${dx.msg}")
166+
complete(HttpResponse(StatusCodes.BadRequest, entity = s"Could not deserialize parameter instance with message: ${dx.getMessage}."))
167167
case px: ParsingException =>
168-
log.error(px, "Failed to parse JSON while registering")
169-
complete(HttpResponse(StatusCodes.BadRequest, entity = s"Failed to parse JSON entity with message ${px.getMessage}"))
168+
log.warning(s"Failed to parse JSON while registering: ${px.summary}")
169+
complete(HttpResponse(StatusCodes.BadRequest, entity = s"Failed to parse JSON entity with message: ${px.getMessage}"))
170170
case x: Exception =>
171-
log.error(x, "Uncaught exception while deserializing.")
171+
log.warning("Uncaught exception while deserializing")
172172
complete(HttpResponse(StatusCodes.InternalServerError, entity = "An internal server error occurred."))
173173
}
174174
}
@@ -237,7 +237,7 @@ class Server(handler: RequestHandler) extends HttpApp
237237
}
238238
}
239239
else {
240-
log.error(s"Failed to deserialize parameter string $compTypeString to ComponentType.")
240+
log.warning(s"Failed to deserialize parameter string $compTypeString to ComponentType.")
241241
complete(HttpResponse(StatusCodes.BadRequest, entity = s"Could not deserialize parameter string $compTypeString to ComponentType"))
242242
}
243243
}
@@ -271,7 +271,7 @@ class Server(handler: RequestHandler) extends HttpApp
271271
}
272272
}
273273
else {
274-
log.error(s"Failed to deserialize parameter string $compTypeString to ComponentType.")
274+
log.warning(s"Failed to deserialize parameter string $compTypeString to ComponentType.")
275275
complete(HttpResponse(StatusCodes.BadRequest, entity = s"Could not deserialize parameter string $compTypeString to ComponentType"))
276276
}
277277
}

0 commit comments

Comments
 (0)