Index: src/ch/CfgProperties.h =================================================================== diff -u -rd18db617f4727a237c94b59af9b4328f829eda16 -rffbc773697bd08220163bf1e4491a34376b0f61c --- src/ch/CfgProperties.h (.../CfgProperties.h) (revision d18db617f4727a237c94b59af9b4328f829eda16) +++ src/ch/CfgProperties.h (.../CfgProperties.h) (revision ffbc773697bd08220163bf1e4491a34376b0f61c) @@ -23,7 +23,10 @@ #include "../libchcore/TTaskConfiguration.h" #include "UpdateVersionInfo.h" +#include +using boost::log::trivial::severity_level; + namespace chcore { class TConfig; } // properties definitions @@ -100,9 +103,17 @@ PP_BFBOUNDARYLIMIT, PP_BFQUEUEDEPTH, - PP_LOGENABLELOGGING, PP_LOGMAXSIZE, - PP_LOGLEVEL, + PP_LOGROTATECOUNT, + PP_LOGLEVEL_APP, + PP_LOGLEVEL_ENGINEDEFAULT, + PP_LOGLEVEL_SERIALIZER, + PP_LOGLEVEL_TASK, + PP_LOGLEVEL_SUBTASK_SCANDIR, + PP_LOGLEVEL_SUBTASK_COPYMOVE, + PP_LOGLEVEL_SUBTASK_FASTMOVE, + PP_LOGLEVEL_SUBTASK_DELETE, + PP_LOGLEVEL_FILESYSTEM, PP_SNDPLAYSOUNDS, PP_SNDERRORSOUNDPATH, @@ -204,9 +215,17 @@ PROPERTY(PP_SHORTCUTS, CStringVector, _T("CHConfig.General.Program.Shortcuts.Shortcut"), (CStringVector())); PROPERTY(PP_RECENTPATHS, CStringVector, _T("CHConfig.General.Program.RecentPaths.Path"), (CStringVector())); -PROPERTY(PP_LOGENABLELOGGING, bool, _T("CHConfig.General.Logging.Enable"), true); -PROPERTY_MINMAX(PP_LOGMAXSIZE, int, _T("CHConfig.General.Logging.SizeLimit"), 512384, 1024, 0xffffffff); -PROPERTY_MINMAX(PP_LOGLEVEL, unsigned int, _T("CHConfig.General.Logging.LoggingLevel"), 1, 0, 3); +PROPERTY_MINMAX(PP_LOGMAXSIZE, int, _T("CHConfig.General.Logging.SizeLimit"), 1024 * 1024, 1024, 0xffffffff); +PROPERTY_MINMAX(PP_LOGROTATECOUNT, int, _T("CHConfig.General.Logging.RotateCount"), 5, 1, 0xffffffff); +PROPERTY_MINMAX(PP_LOGLEVEL_APP, int, _T("CHConfig.General.Logging.Level.App"), boost::log::trivial::warning, boost::log::trivial::trace, boost::log::trivial::fatal); +PROPERTY_MINMAX(PP_LOGLEVEL_ENGINEDEFAULT, int, _T("CHConfig.General.Logging.Level.EngineDefault"), boost::log::trivial::warning, boost::log::trivial::trace, boost::log::trivial::fatal); +PROPERTY_MINMAX(PP_LOGLEVEL_SERIALIZER, int, _T("CHConfig.General.Logging.Level.Serializer"), boost::log::trivial::warning, boost::log::trivial::trace, boost::log::trivial::fatal); +PROPERTY_MINMAX(PP_LOGLEVEL_TASK, int, _T("CHConfig.General.Logging.Level.Task"), boost::log::trivial::warning, boost::log::trivial::trace, boost::log::trivial::fatal); +PROPERTY_MINMAX(PP_LOGLEVEL_SUBTASK_SCANDIR, int, _T("CHConfig.General.Logging.Level.SubtaskScanDir"), boost::log::trivial::warning, boost::log::trivial::trace, boost::log::trivial::fatal); +PROPERTY_MINMAX(PP_LOGLEVEL_SUBTASK_COPYMOVE, int, _T("CHConfig.General.Logging.Level.SubtaskCopyMove"), boost::log::trivial::warning, boost::log::trivial::trace, boost::log::trivial::fatal); +PROPERTY_MINMAX(PP_LOGLEVEL_SUBTASK_FASTMOVE, int, _T("CHConfig.General.Logging.Level.SubtaskFastMove"), boost::log::trivial::warning, boost::log::trivial::trace, boost::log::trivial::fatal); +PROPERTY_MINMAX(PP_LOGLEVEL_SUBTASK_DELETE, int, _T("CHConfig.General.Logging.Level.SubtaskDelete"), boost::log::trivial::warning, boost::log::trivial::trace, boost::log::trivial::fatal); +PROPERTY_MINMAX(PP_LOGLEVEL_FILESYSTEM, int, _T("CHConfig.General.Logging.Level.Filesystem"), boost::log::trivial::warning, boost::log::trivial::trace, boost::log::trivial::fatal); // GUI PROPERTY_MINMAX(PP_STATUSREFRESHINTERVAL, unsigned int, _T("CHConfig.GUI.StatusDialog.RefreshInterval"), 1000, 0, 24*Hour); Index: src/ch/OptionsDlg.cpp =================================================================== diff -u -r4797e4b6b266900bfdcdf4ca6eda47c216ad9db1 -rffbc773697bd08220163bf1e4491a34376b0f61c --- src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision 4797e4b6b266900bfdcdf4ca6eda47c216ad9db1) +++ src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision ffbc773697bd08220163bf1e4491a34376b0f61c) @@ -317,9 +317,17 @@ PROP_UINT(IDS_BUFFER_QUEUE_DEPTH, GetPropValue(GetConfig())); PROP_SEPARATOR(IDS_CFGLOGFILE_STRING); - PROP_BOOL(IDS_CFGENABLELOGGING_STRING, GetPropValue(GetConfig())); PROP_UINT(IDS_CFGMAXLIMIT_STRING, GetPropValue(GetConfig())); - PROP_COMBO(IDS_CFGLOGLEVEL, IDS_CFGLOGLEVEL_VALUES, GetPropValue(GetConfig())); + PROP_UINT(IDS_CFGROTATEDCOUNT_STRING, GetPropValue(GetConfig())); + PROP_COMBO(IDS_CFGLOGLEVEL_APP, IDS_CFGLOGLEVEL_VALUES, GetPropValue(GetConfig())); + PROP_COMBO(IDS_CFGLOGLEVEL_ENGINEDEFAULT, IDS_CFGLOGLEVEL_VALUES, GetPropValue(GetConfig())); + PROP_COMBO(IDS_CFGLOGLEVEL_SERIALIZER, IDS_CFGLOGLEVEL_VALUES, GetPropValue(GetConfig())); + PROP_COMBO(IDS_CFGLOGLEVEL_TASK, IDS_CFGLOGLEVEL_VALUES, GetPropValue(GetConfig())); + PROP_COMBO(IDS_CFGLOGLEVEL_SUBTASK_SCANDIR, IDS_CFGLOGLEVEL_VALUES, GetPropValue(GetConfig())); + PROP_COMBO(IDS_CFGLOGLEVEL_SUBTASK_COPYMOVE, IDS_CFGLOGLEVEL_VALUES, GetPropValue(GetConfig())); + PROP_COMBO(IDS_CFGLOGLEVEL_SUBTASK_FASTMOVE, IDS_CFGLOGLEVEL_VALUES, GetPropValue(GetConfig())); + PROP_COMBO(IDS_CFGLOGLEVEL_SUBTASK_DELETE, IDS_CFGLOGLEVEL_VALUES, GetPropValue(GetConfig())); + PROP_COMBO(IDS_CFGLOGLEVEL_FILESYSTEM, IDS_CFGLOGLEVEL_VALUES, GetPropValue(GetConfig())); // Sounds PROP_SEPARATOR(IDS_SOUNDS_STRING); @@ -437,9 +445,17 @@ // log file SKIP_SEPARATOR(iPosition); - SetPropValue(rConfig, GetBoolProp(iPosition++)); SetPropValue(rConfig, GetUintProp(iPosition++)); - SetPropValue(rConfig, GetIndexProp(iPosition++)); + SetPropValue(rConfig, GetIndexProp(iPosition++)); + SetPropValue(rConfig, GetIndexProp(iPosition++)); + SetPropValue(rConfig, GetIndexProp(iPosition++)); + SetPropValue(rConfig, GetIndexProp(iPosition++)); + SetPropValue(rConfig, GetIndexProp(iPosition++)); + SetPropValue(rConfig, GetIndexProp(iPosition++)); + SetPropValue(rConfig, GetIndexProp(iPosition++)); + SetPropValue(rConfig, GetIndexProp(iPosition++)); + SetPropValue(rConfig, GetIndexProp(iPosition++)); + SetPropValue(rConfig, GetIndexProp(iPosition++)); // Sounds SKIP_SEPARATOR(iPosition); Index: src/ch/ch.cpp =================================================================== diff -u -r62d767936f1675e1db51174f53c91484fe691937 -rffbc773697bd08220163bf1e4491a34376b0f61c --- src/ch/ch.cpp (.../ch.cpp) (revision 62d767936f1675e1db51174f53c91484fe691937) +++ src/ch/ch.cpp (.../ch.cpp) (revision ffbc773697bd08220163bf1e4491a34376b0f61c) @@ -767,5 +767,7 @@ LOG_INFO(m_spLog) << _T("============================ Leaving Copy Handler ============================"); + m_logInitializer.Uninit(); + return __super::ExitInstance(); } Index: src/ch/ch.rc =================================================================== diff -u -rdcc6234ed612a75910b8900704c9d564096a037a -rffbc773697bd08220163bf1e4491a34376b0f61c --- src/ch/ch.rc (.../ch.rc) (revision dcc6234ed612a75910b8900704c9d564096a037a) +++ src/ch/ch.rc (.../ch.rc) (revision ffbc773697bd08220163bf1e4491a34376b0f61c) @@ -847,8 +847,16 @@ IDS_CFG_CHECK_FOR_UPDATES_FREQUENCY "Check for program updates" IDS_CFG_UPDATECHANNEL "Update channel" IDS_CFG_USE_SECURE_CONNECTION "Use secure connection when checking for updates" - IDS_CFGLOGLEVEL "Log level" - IDS_CFGLOGLEVEL_VALUES "Debug!Info!Warning!Error" + IDS_CFGLOGLEVEL_VALUES "Trace!Debug!Info!Warning!Error!Fatal" + IDS_CFGLOGLEVEL_APP "Log level - application" + IDS_CFGLOGLEVEL_ENGINEDEFAULT "Log level - engine" + IDS_CFGLOGLEVEL_SERIALIZER "Log level - data serializer" + IDS_CFGLOGLEVEL_TASK "Log level - task" + IDS_CFGLOGLEVEL_SUBTASK_SCANDIR "Log level - subtask - scan directory" + IDS_CFGLOGLEVEL_SUBTASK_COPYMOVE "Log level - subtask - copy/move" + IDS_CFGLOGLEVEL_SUBTASK_FASTMOVE "Log level - subtask - fast move" + IDS_CFGLOGLEVEL_SUBTASK_DELETE "Log level - subtask - delete" + IDS_CFGLOGLEVEL_FILESYSTEM "Log level - filesystem" IDS_UPDATE_FREQUENCIES "Never!Every startup!Daily!Weekly!Once every 2 weeks!Monthly!Quarterly" IDS_SECURE_CONNECTION_TYPES "No!Yes!Auto" IDS_BUFFER_QUEUE_DEPTH "Buffer queue depth" @@ -1126,8 +1134,8 @@ IDS_PLUGSFOLDER_STRING "Folder with plugins" IDS_PLUGSFOLDERCHOOSE_STRING "!Choose folder with plugins" IDS_CFGLOGFILE_STRING "Debugging" - IDS_CFGENABLELOGGING_STRING "Enable logging" IDS_CFGMAXLIMIT_STRING "Maximum size of the log file" + IDS_CFGROTATEDCOUNT_STRING "Maximum count of rotated log files to keep" IDS_CFGHELPDIR_STRING "Directory with help files" IDS_CFGHELPDIRCHOOSE_STRING "!Choose folder with program's help files" IDS_LANGUAGESFOLDER_STRING "Directory with language files" Index: src/ch/resource.h =================================================================== diff -u -rd18db617f4727a237c94b59af9b4328f829eda16 -rffbc773697bd08220163bf1e4491a34376b0f61c --- src/ch/resource.h (.../resource.h) (revision d18db617f4727a237c94b59af9b4328f829eda16) +++ src/ch/resource.h (.../resource.h) (revision ffbc773697bd08220163bf1e4491a34376b0f61c) @@ -512,8 +512,8 @@ #define IDS_PLUGSFOLDER_STRING 8083 #define IDS_PLUGSFOLDERCHOOSE_STRING 8084 #define IDS_CFGLOGFILE_STRING 8085 -#define IDS_CFGENABLELOGGING_STRING 8086 #define IDS_CFGMAXLIMIT_STRING 8088 +#define IDS_CFGROTATEDCOUNT_STRING 8089 #define IDS_CFGHELPDIR_STRING 8091 #define IDS_CFGHELPDIRCHOOSE_STRING 8092 #define IDS_LANGUAGESFOLDER_STRING 8093 @@ -522,7 +522,6 @@ #define IDS_CFGINTERCEPTCONTEXTMENU_STRING 8096 #define IDS_CFG_CHECK_FOR_UPDATES_FREQUENCY 8097 #define IDS_CFG_UPDATECHANNEL 8098 -#define IDS_CFGLOGLEVEL 8099 #define IDS_CFGLOGLEVEL_VALUES 8100 #define IDS_UPDATE_FREQUENCIES 8101 #define IDS_BUFFER_QUEUE_DEPTH 8102 @@ -532,6 +531,15 @@ #define IDS_USECUSTOMNAMING 8106 #define IDS_CUSTOMNAME_FIRST 8107 #define IDS_CUSTOMNAME_SUBSEQUENT 8108 +#define IDS_CFGLOGLEVEL_APP 8109 +#define IDS_CFGLOGLEVEL_ENGINEDEFAULT 8110 +#define IDS_CFGLOGLEVEL_SERIALIZER 8111 +#define IDS_CFGLOGLEVEL_TASK 8112 +#define IDS_CFGLOGLEVEL_SUBTASK_SCANDIR 8113 +#define IDS_CFGLOGLEVEL_SUBTASK_COPYMOVE 8114 +#define IDS_CFGLOGLEVEL_SUBTASK_FASTMOVE 8115 +#define IDS_CFGLOGLEVEL_SUBTASK_DELETE 8116 +#define IDS_CFGLOGLEVEL_FILESYSTEM 8117 #define IDS_MENUCOPY_STRING 9000 #define IDS_MENUMOVE_STRING 9001 #define IDS_MENUCOPYMOVESPECIAL_STRING 9002 Index: src/common/TLogger.cpp =================================================================== diff -u -r62d767936f1675e1db51174f53c91484fe691937 -rffbc773697bd08220163bf1e4491a34376b0f61c --- src/common/TLogger.cpp (.../TLogger.cpp) (revision 62d767936f1675e1db51174f53c91484fe691937) +++ src/common/TLogger.cpp (.../TLogger.cpp) (revision ffbc773697bd08220163bf1e4491a34376b0f61c) @@ -26,7 +26,8 @@ namespace chcore { TLogger::TLogger(const TLoggerLevelConfigPtr& spLoggerConfig, const TLoggerLocationConfigPtr& spLogLocation, PCTSTR pszChannel) : - Logger(keywords::channel = pszChannel) + Logger(keywords::channel = pszChannel), + m_spLoggerConfig(spLoggerConfig) { if (!spLoggerConfig) throw TCoreException(eErr_InvalidArgument, L"spLoggerConfig", LOCATION);