| 1942 | } |
| 1943 | |
| 1944 | bool VRegistry::allowed(base::type::VerboseLevel vlevel, const char* file) { |
| 1945 | base::threading::ScopedLock scopedLock(lock()); |
| 1946 | if (m_modules.empty() || file == nullptr) { |
| 1947 | return vlevel <= m_level; |
| 1948 | } else { |
| 1949 | char baseFilename[base::consts::kSourceFilenameMaxLength] = ""; |
| 1950 | base::utils::File::buildBaseFilename(file, baseFilename); |
| 1951 | std::map<std::string, base::type::VerboseLevel>::iterator it = m_modules.begin(); |
| 1952 | for (; it != m_modules.end(); ++it) { |
| 1953 | if (base::utils::Str::wildCardMatch(baseFilename, it->first.c_str())) { |
| 1954 | return vlevel <= it->second; |
| 1955 | } |
| 1956 | } |
| 1957 | if (base::utils::hasFlag(LoggingFlag::AllowVerboseIfModuleNotSpecified, *m_pFlags)) { |
| 1958 | return true; |
| 1959 | } |
| 1960 | return false; |
| 1961 | } |
| 1962 | } |
| 1963 | |
| 1964 | void VRegistry::setFromArgs(const base::utils::CommandLineArgs* commandLineArgs) { |
| 1965 | if (commandLineArgs->hasParam("-v") || commandLineArgs->hasParam("--verbose") || |