diff options
author | Justin Clark-Casey (justincc) | 2013-10-30 18:32:53 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-10-30 18:32:53 +0000 |
commit | 28f36d8db5b60c2053813416b867ef0d9501995f (patch) | |
tree | b0f7793502be867f9830b6bd84d5271a05ccb7b8 /OpenSim | |
parent | Give the caller AddMapTile a valid reason response if this failed due to blan... (diff) | |
download | opensim-SC-28f36d8db5b60c2053813416b867ef0d9501995f.zip opensim-SC-28f36d8db5b60c2053813416b867ef0d9501995f.tar.gz opensim-SC-28f36d8db5b60c2053813416b867ef0d9501995f.tar.bz2 opensim-SC-28f36d8db5b60c2053813416b867ef0d9501995f.tar.xz |
Put fcache commands output to console, not log
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 2afe065..103228f 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs | |||
@@ -36,12 +36,10 @@ using System.Runtime.Serialization; | |||
36 | using System.Runtime.Serialization.Formatters.Binary; | 36 | using System.Runtime.Serialization.Formatters.Binary; |
37 | using System.Threading; | 37 | using System.Threading; |
38 | using System.Timers; | 38 | using System.Timers; |
39 | |||
40 | using log4net; | 39 | using log4net; |
41 | using Nini.Config; | 40 | using Nini.Config; |
42 | using Mono.Addins; | 41 | using Mono.Addins; |
43 | using OpenMetaverse; | 42 | using OpenMetaverse; |
44 | |||
45 | using OpenSim.Framework; | 43 | using OpenSim.Framework; |
46 | using OpenSim.Framework.Console; | 44 | using OpenSim.Framework.Console; |
47 | using OpenSim.Region.Framework.Interfaces; | 45 | using OpenSim.Region.Framework.Interfaces; |
@@ -810,34 +808,36 @@ namespace OpenSim.Region.CoreModules.Asset | |||
810 | #region Console Commands | 808 | #region Console Commands |
811 | private void HandleConsoleCommand(string module, string[] cmdparams) | 809 | private void HandleConsoleCommand(string module, string[] cmdparams) |
812 | { | 810 | { |
811 | ICommandConsole con = MainConsole.Instance; | ||
812 | |||
813 | if (cmdparams.Length >= 2) | 813 | if (cmdparams.Length >= 2) |
814 | { | 814 | { |
815 | string cmd = cmdparams[1]; | 815 | string cmd = cmdparams[1]; |
816 | |||
816 | switch (cmd) | 817 | switch (cmd) |
817 | { | 818 | { |
818 | case "status": | 819 | case "status": |
819 | if (m_MemoryCacheEnabled) | 820 | if (m_MemoryCacheEnabled) |
820 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Memory Cache : {0} assets", m_MemoryCache.Count); | 821 | con.OutputFormat("Memory Cache : {0} assets", m_MemoryCache.Count); |
821 | else | 822 | else |
822 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Memory cache disabled"); | 823 | con.OutputFormat("Memory cache disabled"); |
823 | 824 | ||
824 | if (m_FileCacheEnabled) | 825 | if (m_FileCacheEnabled) |
825 | { | 826 | { |
826 | int fileCount = GetFileCacheCount(m_CacheDirectory); | 827 | int fileCount = GetFileCacheCount(m_CacheDirectory); |
827 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: File Cache : {0} assets", fileCount); | 828 | con.OutputFormat("File Cache : {0} assets", fileCount); |
829 | con.Output("Deep scans have previously been performed on the following regions:"); | ||
828 | 830 | ||
829 | foreach (string s in Directory.GetFiles(m_CacheDirectory, "*.fac")) | 831 | foreach (string s in Directory.GetFiles(m_CacheDirectory, "*.fac")) |
830 | { | 832 | { |
831 | m_log.Info("[FLOTSAM ASSET CACHE]: Deep scans have previously been performed on the following regions:"); | ||
832 | |||
833 | string RegionID = s.Remove(0,s.IndexOf("_")).Replace(".fac",""); | 833 | string RegionID = s.Remove(0,s.IndexOf("_")).Replace(".fac",""); |
834 | DateTime RegionDeepScanTMStamp = File.GetLastWriteTime(s); | 834 | DateTime RegionDeepScanTMStamp = File.GetLastWriteTime(s); |
835 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Region: {0}, {1}", RegionID, RegionDeepScanTMStamp.ToString("MM/dd/yyyy hh:mm:ss")); | 835 | con.OutputFormat("Region: {0}, {1}", RegionID, RegionDeepScanTMStamp.ToString("MM/dd/yyyy hh:mm:ss")); |
836 | } | 836 | } |
837 | } | 837 | } |
838 | else | 838 | else |
839 | { | 839 | { |
840 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: File cache disabled"); | 840 | con.Output("File cache disabled"); |
841 | } | 841 | } |
842 | 842 | ||
843 | break; | 843 | break; |
@@ -845,7 +845,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
845 | case "clear": | 845 | case "clear": |
846 | if (cmdparams.Length < 2) | 846 | if (cmdparams.Length < 2) |
847 | { | 847 | { |
848 | m_log.Warn("[FLOTSAM ASSET CACHE]: Usage is fcache clear [file] [memory]"); | 848 | con.Output("Usage is fcache clear [file] [memory]"); |
849 | break; | 849 | break; |
850 | } | 850 | } |
851 | 851 | ||
@@ -869,11 +869,11 @@ namespace OpenSim.Region.CoreModules.Asset | |||
869 | if (m_MemoryCacheEnabled) | 869 | if (m_MemoryCacheEnabled) |
870 | { | 870 | { |
871 | m_MemoryCache.Clear(); | 871 | m_MemoryCache.Clear(); |
872 | m_log.Info("[FLOTSAM ASSET CACHE]: Memory cache cleared."); | 872 | con.Output("Memory cache cleared."); |
873 | } | 873 | } |
874 | else | 874 | else |
875 | { | 875 | { |
876 | m_log.Info("[FLOTSAM ASSET CACHE]: Memory cache not enabled."); | 876 | con.Output("Memory cache not enabled."); |
877 | } | 877 | } |
878 | } | 878 | } |
879 | 879 | ||
@@ -882,24 +882,22 @@ namespace OpenSim.Region.CoreModules.Asset | |||
882 | if (m_FileCacheEnabled) | 882 | if (m_FileCacheEnabled) |
883 | { | 883 | { |
884 | ClearFileCache(); | 884 | ClearFileCache(); |
885 | m_log.Info("[FLOTSAM ASSET CACHE]: File cache cleared."); | 885 | con.Output("File cache cleared."); |
886 | } | 886 | } |
887 | else | 887 | else |
888 | { | 888 | { |
889 | m_log.Info("[FLOTSAM ASSET CACHE]: File cache not enabled."); | 889 | con.Output("File cache not enabled."); |
890 | } | 890 | } |
891 | } | 891 | } |
892 | 892 | ||
893 | break; | 893 | break; |
894 | 894 | ||
895 | case "assets": | 895 | case "assets": |
896 | m_log.Info("[FLOTSAM ASSET CACHE]: Ensuring assets are cached for all scenes."); | 896 | con.Output("Ensuring assets are cached for all scenes."); |
897 | 897 | ||
898 | Util.FireAndForget(delegate { | 898 | Util.FireAndForget(delegate { |
899 | int assetReferenceTotal = TouchAllSceneAssets(true); | 899 | int assetReferenceTotal = TouchAllSceneAssets(true); |
900 | m_log.InfoFormat( | 900 | con.OutputFormat("Completed check with {0} assets.", assetReferenceTotal); |
901 | "[FLOTSAM ASSET CACHE]: Completed check with {0} assets.", | ||
902 | assetReferenceTotal); | ||
903 | }); | 901 | }); |
904 | 902 | ||
905 | break; | 903 | break; |
@@ -907,7 +905,7 @@ namespace OpenSim.Region.CoreModules.Asset | |||
907 | case "expire": | 905 | case "expire": |
908 | if (cmdparams.Length < 3) | 906 | if (cmdparams.Length < 3) |
909 | { | 907 | { |
910 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Invalid parameters for Expire, please specify a valid date & time", cmd); | 908 | con.OutputFormat("Invalid parameters for Expire, please specify a valid date & time", cmd); |
911 | break; | 909 | break; |
912 | } | 910 | } |
913 | 911 | ||
@@ -925,28 +923,27 @@ namespace OpenSim.Region.CoreModules.Asset | |||
925 | 923 | ||
926 | if (!DateTime.TryParse(s_expirationDate, out expirationDate)) | 924 | if (!DateTime.TryParse(s_expirationDate, out expirationDate)) |
927 | { | 925 | { |
928 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: {0} is not a valid date & time", cmd); | 926 | con.OutputFormat("{0} is not a valid date & time", cmd); |
929 | break; | 927 | break; |
930 | } | 928 | } |
931 | 929 | ||
932 | if (m_FileCacheEnabled) | 930 | if (m_FileCacheEnabled) |
933 | CleanExpiredFiles(m_CacheDirectory, expirationDate); | 931 | CleanExpiredFiles(m_CacheDirectory, expirationDate); |
934 | else | 932 | else |
935 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: File cache not active, not clearing."); | 933 | con.OutputFormat("File cache not active, not clearing."); |
936 | 934 | ||
937 | break; | 935 | break; |
938 | default: | 936 | default: |
939 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Unknown command {0}", cmd); | 937 | con.OutputFormat("Unknown command {0}", cmd); |
940 | break; | 938 | break; |
941 | } | 939 | } |
942 | } | 940 | } |
943 | else if (cmdparams.Length == 1) | 941 | else if (cmdparams.Length == 1) |
944 | { | 942 | { |
945 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: fcache status - Display cache status"); | 943 | con.Output("fcache assets - Attempt a deep cache of all assets in all scenes"); |
946 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: fcache clearmem - Remove all assets cached in memory"); | 944 | con.Output("fcache expire <datetime> - Purge assets older then the specified date & time"); |
947 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: fcache clearfile - Remove all assets cached on disk"); | 945 | con.Output("fcache clear [file] [memory] - Remove cached assets"); |
948 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: fcache cachescenes - Attempt a deep cache of all assets in all scenes"); | 946 | con.Output("fcache status - Display cache status"); |
949 | m_log.InfoFormat("[FLOTSAM ASSET CACHE]: fcache <datetime> - Purge assets older then the specified date & time"); | ||
950 | } | 947 | } |
951 | } | 948 | } |
952 | 949 | ||