mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
improve logging
This commit is contained in:
@@ -174,6 +174,7 @@ public class HgUtil
|
|||||||
output = p.getOutputStream();
|
output = p.getOutputStream();
|
||||||
IOUtil.copy(resource, output);
|
IOUtil.copy(resource, output);
|
||||||
output.close();
|
output.close();
|
||||||
|
handleErrorStream(p.getErrorStream());
|
||||||
input = p.getInputStream();
|
input = p.getInputStream();
|
||||||
result = (T) context.createUnmarshaller().unmarshal(input);
|
result = (T) context.createUnmarshaller().unmarshal(input);
|
||||||
input.close();
|
input.close();
|
||||||
@@ -266,4 +267,39 @@ public class HgUtil
|
|||||||
? REVISION_TIP
|
? REVISION_TIP
|
||||||
: revision;
|
: revision;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param errorStream
|
||||||
|
*/
|
||||||
|
private static void handleErrorStream(final InputStream errorStream)
|
||||||
|
{
|
||||||
|
if (errorStream != null)
|
||||||
|
{
|
||||||
|
new Thread(new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
String content = IOUtil.getContent(errorStream);
|
||||||
|
|
||||||
|
if (Util.isNotEmpty(content))
|
||||||
|
{
|
||||||
|
logger.error(content.trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (IOException ex)
|
||||||
|
{
|
||||||
|
logger.error("error during logging", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user