mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
More polishing of some of the branche's changes.
This commit is contained in:
parent
0ba4b768cd
commit
8031da4ee7
7 changed files with 9 additions and 16 deletions
|
@ -6,9 +6,9 @@
|
||||||
module Log;
|
module Log;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
## Type that defines a ID unique for each log stream. Scripts creating new log
|
## Type that defines an ID unique to each log stream. Scripts creating new log
|
||||||
## streams need to redef this enum to add their own specific log ID. The log ID
|
## streams need to redef this enum to add their own specific log ID. The log ID
|
||||||
## implicitly determines the default name of the generated log file.
|
## implicitly determines the default name of the generated log file.
|
||||||
type Log::ID: enum {
|
type Log::ID: enum {
|
||||||
## Dummy place-holder.
|
## Dummy place-holder.
|
||||||
UNKNOWN
|
UNKNOWN
|
||||||
|
@ -33,13 +33,13 @@ export {
|
||||||
const set_separator = "," &redef;
|
const set_separator = "," &redef;
|
||||||
|
|
||||||
## String to use for empty fields. This should be different from
|
## String to use for empty fields. This should be different from
|
||||||
## *unset_field* to make the output unambiguous.
|
## *unset_field* to make the output unambiguous.
|
||||||
## Can be overwritten by individual writers.
|
## Can be overwritten by individual writers.
|
||||||
const empty_field = "(empty)" &redef;
|
const empty_field = "(empty)" &redef;
|
||||||
|
|
||||||
## String to use for an unset &optional field.
|
## String to use for an unset &optional field.
|
||||||
## Can be overwritten by individual writers.
|
## Can be overwritten by individual writers.
|
||||||
const unset_field = "-" &redef;
|
const unset_field = "-" &redef;
|
||||||
|
|
||||||
## Type defining the content of a logging stream.
|
## Type defining the content of a logging stream.
|
||||||
type Stream: record {
|
type Stream: record {
|
||||||
|
|
|
@ -57,4 +57,4 @@ function default_rotation_postprocessor_func(info: Log::RotationInfo) : bool
|
||||||
return Log::run_rotation_postprocessor_cmd(info, dst);
|
return Log::run_rotation_postprocessor_cmd(info, dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
# redef Log::default_rotation_postprocessors += { [Log::WRITER_DATASERIES] = default_rotation_postprocessor_func };
|
redef Log::default_rotation_postprocessors += { [Log::WRITER_DATASERIES] = default_rotation_postprocessor_func };
|
||||||
|
|
|
@ -13,5 +13,5 @@ function default_rotation_postprocessor_func(info: Log::RotationInfo) : bool
|
||||||
return T;
|
return T;
|
||||||
}
|
}
|
||||||
|
|
||||||
# redef Log::default_rotation_postprocessors += { [Log::WRITER_NONE] = default_rotation_postprocessor_func };
|
redef Log::default_rotation_postprocessors += { [Log::WRITER_NONE] = default_rotation_postprocessor_func };
|
||||||
|
|
||||||
|
|
|
@ -3364,7 +3364,6 @@ const global_hash_seed: string = "" &redef;
|
||||||
## The maximum is currently 128 bits.
|
## The maximum is currently 128 bits.
|
||||||
const bits_per_uid: count = 96 &redef;
|
const bits_per_uid: count = 96 &redef;
|
||||||
|
|
||||||
|
|
||||||
# Load these frameworks here because they use fairly deep integration with
|
# Load these frameworks here because they use fairly deep integration with
|
||||||
# BiFs and script-land defined types.
|
# BiFs and script-land defined types.
|
||||||
@load base/frameworks/logging
|
@load base/frameworks/logging
|
||||||
|
|
|
@ -1476,9 +1476,9 @@ void EnumType::CheckAndAddName(const string& module_name, const char* name,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// We allow double-definitions if matching exactly. This is
|
// We allow double-definitions if matching exactly. This is so that
|
||||||
// so that we can define an enum both in a *.bif and *.bro to
|
// we can define an enum both in a *.bif and *.bro for avoiding
|
||||||
// avoid cyclic dependencies.
|
// cyclic dependencies.
|
||||||
if ( id->Name() != make_full_var_name(module_name.c_str(), name)
|
if ( id->Name() != make_full_var_name(module_name.c_str(), name)
|
||||||
|| (id->HasVal() && val != id->ID_Val()->AsEnum()) )
|
|| (id->HasVal() && val != id->ID_Val()->AsEnum()) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
#include "Component.h"
|
#include "Component.h"
|
||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
|
|
||||||
#include "../Desc.h"
|
#include "../Desc.h"
|
||||||
#include "../util.h"
|
#include "../util.h"
|
||||||
|
|
||||||
|
@ -25,5 +24,3 @@ void Component::DoDescribe(ODesc* d) const
|
||||||
d->Add("Log::WRITER_");
|
d->Add("Log::WRITER_");
|
||||||
d->Add(CanonicalName());
|
d->Add(CanonicalName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -135,8 +135,6 @@ ComponentManager<T, C>::ComponentManager(const string& arg_module, const string&
|
||||||
::ID* id = install_ID(local_id.c_str(), module.c_str(), true, true);
|
::ID* id = install_ID(local_id.c_str(), module.c_str(), true, true);
|
||||||
add_type(id, tag_enum_type, 0);
|
add_type(id, tag_enum_type, 0);
|
||||||
broxygen_mgr->Identifier(id);
|
broxygen_mgr->Identifier(id);
|
||||||
|
|
||||||
// fprintf(stderr, "Enum: %s\n", id->Name());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T, class C>
|
template <class T, class C>
|
||||||
|
@ -246,7 +244,6 @@ void ComponentManager<T, C>::RegisterComponent(C* component,
|
||||||
string id = fmt("%s%s", prefix.c_str(), cname.c_str());
|
string id = fmt("%s%s", prefix.c_str(), cname.c_str());
|
||||||
tag_enum_type->AddName(module, id.c_str(),
|
tag_enum_type->AddName(module, id.c_str(),
|
||||||
component->Tag().AsEnumVal()->InternalInt(), true);
|
component->Tag().AsEnumVal()->InternalInt(), true);
|
||||||
// fprintf(stderr, "Enum item: %s/%s\n", module.c_str(), id.c_str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace plugin
|
} // namespace plugin
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue