Skip to content

Instantly share code, notes, and snippets.

View mitsuhiko's full-sized avatar
🖥️
What's happening

Armin Ronacher mitsuhiko

🖥️
What's happening
View GitHub Profile
{
"event_id": "cdbe646b-de0e-4f85-bdc5-2703bc517bdf"
}
->
Event {
id: Annotated {
value: Maybe::Valid(Uuid("cdbe646b-de0e-4f85-bdc5-2703bc517bdf")),
metadata: MetaData { errors: vec![] },
pub fn add_scope_processor<F, B>(&mut self, f: F)
where
F: Fn(&mut Event) + Sync + Send,
Box<F>: im::shared::Shared<Box<Fn(&mut Event) + Sync + Send>>,
{
self.scope_processors = self.scope_processors.push_back(Box::new(f));
}
pub fn add_scope_processor<F>(&mut self, f: Box<F>)
where
F: Fn(&mut Event) + Sync + Send + ?Sized,
Box<F>: im::shared::Shared<Box<Fn(&mut Event) + Sync + Send>>,
{
self.scope_processors = self.scope_processors.push_back(f);
}
#[derive(Clone)]
pub struct Scope {
pub(crate) fingerprint: Option<Arc<Vec<Cow<'static, str>>>>,
pub(crate) transaction: Option<Arc<String>>,
pub(crate) breadcrumbs: im::Vector<Breadcrumb>,
pub(crate) user: Option<Arc<User>>,
pub(crate) extra: im::HashMap<String, Value>,
pub(crate) tags: im::HashMap<String, String>,
pub(crate) contexts: im::HashMap<String, Option<Context>>,
pub(crate) scope_processors: im::Vector<Box<FnMut(&mut Event) + Sync + Send>>,
use std::fmt::Debug;
trait Foo: Debug + 'static {
// either remove this method
fn debug(&self) -> String where Self: Sized {
format!("{:?}", self)
}
}
impl Foo {
/// Helper trait to downcast a response error into a fail.
pub trait ResponseErrorAsFail {
/// Returns the response error as fail.
fn as_fail(&self) -> &Fail;
/// Returns the response error as mut fail.
fn as_mut_fail(&mut self) -> &mut Fail;
}
#[doc(hidden)]
impl<T: ResponseError> ResponseErrorAsFail for T {
File "/Users/mitsuhiko/Development/jinja2/tests/conftest.py", line 17, in <module>
from jinja2 import loaders
File "/Users/mitsuhiko/Development/jinja2/jinja2/__init__.py", line 80, in <module>
_patch_async()
File "/Users/mitsuhiko/Development/jinja2/jinja2/__init__.py", line 76, in _patch_async
from jinja2.asyncsupport import patch_all
File "/Users/mitsuhiko/Development/jinja2/jinja2/asyncsupport.py", line 13, in <module>
import asyncio
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/__init__.py", line 49, in <module>
from .unix_events import * # pragma: no cover
sentry-cli-Darwin-x86_64`thread_local::thread_id::get::hc2a84d0e0859fd2f:
-> 0x1005d384b <+123>: movdqa (%rax), %xmm0
0x1005d384f <+127>: movq $0x1, (%rax)
0x1005d3856 <+134>: movq %rcx, 0x8(%rax)
0x1005d385a <+138>: movdqa %xmm0, -0x20(%rbp)
Target 0: (sentry-cli-Darwin-x86_64) stopped.
(lldb) bt
* thread #2, stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
* frame #0: 0x00000001005d384b sentry-cli-Darwin-x86_64`thread_local::thread_id::get::hc2a84d0e0859fd2f + 123
frame #1: 0x00000001005763d6 sentry-cli-Darwin-x86_64`regex::re_unicode::Regex::captures::hd2ce31a6cd7fdbc7 + 70
use std::mem;
use std::ptr;
use std::sync::Arc;
use std::collections::HashMap;
fn main() {
let mut hm = HashMap::new();
let key = (Arc::new("1".to_string()), Arc::new("2".to_string()));
let data = vec![key.0.clone(), key.1.clone()];
use std::panic;
extern crate sentry;
extern crate log;
pub struct Logger;
impl log::Log for Logger {
fn enabled(&self, metadata: &log::Metadata) -> bool {
metadata.level() <= log::max_level()