package com.mindscapehq.raygun4java.core.messages;

import java.awt.*;
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import java.lang.management.OperatingSystemMXBean;
import java.util.Locale;
import java.util.TimeZone;
import java.util.logging.Level;
import java.util.logging.Logger;

public class RaygunEnvironmentMessage {

	private String cpu;
	private String architecture;
	private int processorCount;
	private String osVersion;
	private int windowBoundsWidth;
	private int windowBoundsHeight;
	private String currentOrientation;
	private String locale;
	private long totalPhysicalMemory;
	private long availablePhysicalMemory;
	private long totalVirtualMemory;
	private long availableVirtualMemory;
	private int diskSpaceFree;
	private double utcOffset;
	private static String message = "Couldn't access all environment data. If you are running in GAE or a restricted environment this is expected";
	private static Logger logger = Logger.getLogger("Raygun4Java");

	public RaygunEnvironmentMessage() {
		try {
			utcOffset = TimeZone.getDefault().getRawOffset() / 3600000.0;
		} catch (Throwable t) {
			logger.log(Level.WARNING, RaygunEnvironmentMessage.message, t);
		}

		try {
			locale = Locale.getDefault().getLanguage() + "-"
					+ Locale.getDefault().getCountry();
		} catch (Throwable t) {
			logger.log(Level.WARNING, RaygunEnvironmentMessage.message, t);
		}

		try {
			windowBoundsWidth = GraphicsEnvironment
					.getLocalGraphicsEnvironment().getMaximumWindowBounds().width;
			windowBoundsHeight = GraphicsEnvironment
					.getLocalGraphicsEnvironment().getMaximumWindowBounds().height;
		} catch (Throwable t) {
			logger.log(Level.WARNING, RaygunEnvironmentMessage.message, t);
		}

		try {
			processorCount = Runtime.getRuntime().availableProcessors();
		} catch (Throwable t) {
			logger.log(Level.WARNING, RaygunEnvironmentMessage.message, t);
		}

		try {
			MemoryMXBean memBean = ManagementFactory.getMemoryMXBean();

			totalVirtualMemory = memBean.getHeapMemoryUsage().getMax()
					+ memBean.getNonHeapMemoryUsage().getMax();
			availableVirtualMemory = memBean.getHeapMemoryUsage().getUsed()
					+ memBean.getNonHeapMemoryUsage().getUsed();
		} catch (Throwable t) {
			logger.log(Level.WARNING, RaygunEnvironmentMessage.message, t);
		}

		try {
			OperatingSystemMXBean osMXBean = ManagementFactory
					.getOperatingSystemMXBean();
			architecture = osMXBean.getArch();
			osVersion = osMXBean.getName() + " - " + osMXBean.getVersion();
		} catch (Throwable t) {
			logger.log(Level.WARNING, RaygunEnvironmentMessage.message, t);
		}
	}
}

@@ -1006,12 +1006,24 @@
 Java
+.environment
 %22);%0A
-
 %0A%09pu
@@ -1167,39 +1167,36 @@
 ogger.log(Level.
-WARNING
+INFO
 , RaygunEnvironm
@@ -1363,39 +1363,36 @@
 ogger.log(Level.
-WARNING
+INFO
 , RaygunEnvironm
@@ -1690,39 +1690,36 @@
 ogger.log(Level.
-WARNING
+INFO
 , RaygunEnvironm
@@ -1857,39 +1857,36 @@
 ogger.log(Level.
-WARNING
+INFO
 , RaygunEnvironm
@@ -2252,39 +2252,36 @@
 ogger.log(Level.
-WARNING
+INFO
 , RaygunEnvironm
@@ -2560,15 +2560,12 @@
 vel.
-WARNING
+INFO
 , Ra

Set level to info and namespace environment log statements