Skip to content

Commit

Permalink
launch default browser on start
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrews committed Dec 31, 2016
1 parent 9ba49e1 commit 16dcc3f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/scala/com/jdrews/logstation/LogStation.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.jdrews.logstation

import java.io.{BufferedWriter, File, FileWriter}
import java.awt.Desktop;
import java.net.URI;

import akka.actor.Props
import akka.event.Logging
import akka.pattern._

import com.jdrews.logstation.config.{BridgeController, DefaultConfigHolder, GlobalActorSystem}
import com.jdrews.logstation.service.{LogStationServiceActor, ServiceShutdown}
import com.jdrews.logstation.tailer.LogThisFile
Expand All @@ -16,7 +19,6 @@ import scala.concurrent.Await
import scala.concurrent.duration._
import scala.util.matching.Regex


/**
* Created by jdrews on 2/21/2015.
*
Expand Down Expand Up @@ -102,6 +104,12 @@ object LogStation extends App {
logStationServiceActor ! syntaxList
logs.foreach(log => logStationServiceActor ! new LogThisFile(log))

// Launch a browser with this URL if available
if(Desktop.isDesktopSupported())
{
Desktop.getDesktop().browse(new URI("http://127.0.0.1:" + webServerPort.toString));
}

private def shutdown: Unit = {
logger.info("Shutdown hook caught.")
webServer.stop
Expand Down

0 comments on commit 16dcc3f

Please sign in to comment.