#552 add some log when crawler stop

pull/570/head WebMagic-0.7.0.alpha
yihua.huang 8 years ago
parent cbf80af5dd
commit e8abc28072

@ -303,7 +303,7 @@ public class Spider implements Runnable, Task {
public void run() {
checkRunningStat();
initComponent();
logger.info("Spider " + getUUID() + " started!");
logger.info("Spider {} started!",getUUID());
while (!Thread.currentThread().isInterrupted() && stat.get() == STAT_RUNNING) {
final Request request = scheduler.poll(this);
if (request == null) {
@ -335,6 +335,7 @@ public class Spider implements Runnable, Task {
if (destroyWhenExit) {
close();
}
logger.info("Spider {} closed! {} pages downloaded.", getUUID(), pageCount.get());
}
protected void onError(Request request) {

Loading…
Cancel
Save